Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mise en place de la CI pour les tests
Browse files Browse the repository at this point in the history
pierrelemee committed Dec 17, 2024

Verified

This commit was signed with the committer’s verified signature.
BerndKue Bernd
1 parent a53f1fd commit 2c4d884
Showing 5 changed files with 112 additions and 167 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Test

on:
push:
branches:
- '**'

env:
APP_ENV: test
APP_SECRET: bafc23a0315b735289c499a886798934
APP_DEBUG: false
DATABASE_URL: pgsql://precontentieux:precontentieux@localhost:5432/precontest?serverVersion=15
PRECONTENTIEUX_COURRIEL_EQUIPE: [email protected]
COMPOSER_ALLOW_SUPERUSER: 1
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: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: precontentieux
POSTGRES_DB: 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
- uses: browser-actions/setup-firefox@v1
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}

- uses: php-actions/composer@v6
with:
php_version: '8.2'
php_extensions: 'zip intl calendar gd pdo pdo_pgsql pgsql'
interaction: 'no'
args: "--optimize-autoloader"

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: 'zip, intl, calendarn gd, pdo, pdo_pgsql, pgsql'

- name: Install yarn dependencies & build assets
run: |
yarn install --no-progress --non-interactive
yarn build
- name: Run migration
run: bin/console doctrine:migrations:migrate --no-interaction --all-or-nothing

- name: Detect headless browser driver
run: vendor/bin/bdi detect drivers

- name: Running unit test
uses: php-actions/phpunit@v3
with:
php_version: '8.2'
php_extensions: 'zip intl calendar gd pdo pdo_pgsql pgsql'
memory_limit: -1
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🇫🇷 👩‍⚖️ 🤝 Précontentieux
# 🇫🇷 👩‍⚖️ 🤝 Mon Indemnisation Justice (ex Précontentieux)

## Installation

1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
"ext-iconv": "*",
"acsiomatic/device-detector-bundle": "^0.5.0",
"api-platform/core": "^3.2",
"clegginabox/pdf-merger": "dev-master",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",
167 changes: 3 additions & 164 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@
<!-- ###+ sentry/sentry-symfony ### -->
<env name="SENTRY_DSN" value=""/>
<env name="APP_ENV" value="test" force="true"/>
<env name="DATABASE_URL" value="pgsql://precontentieux:precontentieux@postgres:5432/precontest?serverVersion=15&amp;charset=utf8" force="true" />
<env name="CORS_ALLOW_ORIGIN" value="*" force="true" />
<!-- ###- sentry/sentry-symfony ### -->
</php>

0 comments on commit 2c4d884

Please sign in to comment.