🔥 chore(install-deps.yml): Supprime les jobs d'installation et de test, garde seulement le déploiement.
This commit is contained in:
108
.github/workflows/install-deps.yml
vendored
108
.github/workflows/install-deps.yml
vendored
@@ -20,117 +20,9 @@ permissions:
|
||||
security-events: write # Requis pour Snyk pour poster les résultats
|
||||
|
||||
jobs:
|
||||
# =================================================================
|
||||
# JOB 1: INSTALL - Installe les dépendances PHP et JS
|
||||
# =================================================================
|
||||
install:
|
||||
name: 📦 Install Dependencies
|
||||
runs-on: self-hosted
|
||||
container:
|
||||
image: registre.esy-web.dev/actions:latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP and Composer
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
tools: symfony-cli
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-suggest --no-interaction --prefer-dist
|
||||
|
||||
- name: Install Bun dependencies
|
||||
run: |
|
||||
if [ -f "package.json" ]; then
|
||||
bun install
|
||||
else
|
||||
echo "Warning: No package.json found. Skipping Bun install."
|
||||
fi
|
||||
# =================================================================
|
||||
# JOB 2: TEST - Lance les tests (unité, statique, sécurité)
|
||||
# =================================================================
|
||||
test:
|
||||
name: 📦 Install Dependencies
|
||||
runs-on: self-hosted
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_DB: symfony_user
|
||||
POSTGRES_USER: your_db_user
|
||||
POSTGRES_PASSWORD: app_db_test
|
||||
redis:
|
||||
image: redis:7
|
||||
|
||||
needs: install
|
||||
container:
|
||||
image: registre.esy-web.dev/actions:latest
|
||||
|
||||
env:
|
||||
APP_ENV: test
|
||||
MESSENGER_TRANSPORT_DSN: doctrine://default?auto_setup=0
|
||||
DATABASE_URL: postgres://your_db_user:app_db_test@postgres:5432/symfony_user?serverVersion=16&charset=utf8
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP and Composer
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
tools: symfony-cli
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --no-suggest --no-interaction --prefer-dist
|
||||
|
||||
- name: Install Bun dependencies
|
||||
run: |
|
||||
if [ -f "package.json" ]; then
|
||||
bun install
|
||||
else
|
||||
echo "Warning: No package.json found. Skipping Bun install."
|
||||
fi
|
||||
|
||||
- name: Setup PHP for testing
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
extensions: fileinfo, intl, dom, pdo, pgsql, redis, opcache, bcmath, zip
|
||||
tools: symfony-cli
|
||||
coverage: pcov
|
||||
|
||||
- name: Create .env.test file
|
||||
run: |
|
||||
echo "APP_ENV=test" > .env.test
|
||||
echo "DATABASE_URL=${{ env.DATABASE_URL }}" >> .env.test
|
||||
# ... autres variables ...
|
||||
|
||||
- name: Create Test Database and Schema
|
||||
run: |
|
||||
php bin/console doctrine:database:create --if-not-exists --env=test
|
||||
php bin/console doctrine:migrations:migrate --env=test --no-interaction --allow-no-migration
|
||||
|
||||
- name: Run PHP Security Checker
|
||||
uses: symfonycorp/security-checker-action@v5
|
||||
with:
|
||||
lock: composer.lock
|
||||
|
||||
# - name: Run PHPUnit Tests
|
||||
# run: php vendor/bin/phpunit --coverage-text
|
||||
|
||||
# - name: SonarQube Scan
|
||||
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
# uses: SonarSource/sonarqube-scan-action@master
|
||||
# env:
|
||||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
deploy:
|
||||
name: 🚀 Deploy to Production
|
||||
runs-on: self-hosted
|
||||
needs: [test]
|
||||
steps:
|
||||
- name: Deploy with SSH & Ansible
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
|
||||
Reference in New Issue
Block a user