Mise en place de la CI pour les tests #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- '**' | |
env: | |
APP_ENV: test | |
APP_SECRET: bafc23a0315b735289c499a886798934 | |
APP_DEBUG: false | |
DATABASE_URL: pgsql://precontentieux:precontentieux@postgres:5432/precontest?serverVersion=15 | |
PRECONTENTIEUX_COURRIEL_EQUIPE: [email protected] | |
COMPOSER_ALLOW_SUPERUSER: 1 | |
POSTGRES_DB: precontest | |
POSTGRES_PASSWORD: precontentieux | |
POSTGRES_USER: precontentieux | |
BASE_URL: precontentieux.test | |
MAILER_FROM: [email protected] | |
MAILER_DSN: smtp://mailpit:1025 | |
CORS_ALLOW_ORIGIN: "*" | |
EMAIL_FROM: [email protected] | |
EMAIL_FROM_LABEL: "Mon Indemnisation Justice (test)" | |
SYMFONY_DEPRECATIONS_HELPER: disabled | |
PANTHER_ERROR_SCREENSHOT_DIR: public/screenshots | |
PANTHER_ERROR_SCREENSHOT_ATTACH: true | |
permissions: | |
contents: read | |
issues: read | |
checks: write | |
pull-requests: write | |
jobs: | |
test: | |
runs-on: pierrelemee/precontentieux-full:latest | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: precontentieux | |
POSTGRES_NAME: precontest | |
POSTGRES_HOST: postgres | |
POSTGRES_PASSWORD: precontentieux | |
POSTGRES_PORT: 5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mailpit: | |
image: axllent/mailpit | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
yarn install | |
- name: Run migration | |
run: bin/console doctrine:migrations:migrate --no-interaction --all-or-nothing | |
- name: Run test | |
run: | | |
vendor/bin/bdi detect drivers | |
bin/phpunit --log-junit test-result.xml | |
- name: Check test result file exists | |
id: check_test_result_file | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: test-result.xml | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: ${{ steps.check_test_result_file.outputs.files_exists == 'true' }} | |
with: | |
files: | | |
test-result.xml |