chore: fix ci 2 #3
Workflow file for this run
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: backend | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
lint-and-tests: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: "mysql://user1:password1@localhost:3306/auto_entreprise_test" | |
DIRECTORY: ./backend | |
services: | |
mariadb: | |
image: mariadb:10.9 | |
env: | |
MYSQL_ROOT_PASSWORD: secret | |
MYSQL_USER: user1 | |
MYSQL_PASSWORD: password1 | |
MYSQL_DATABASE: auto_entreprise_test | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: ctype, iconv, mbstring, mysql | |
tools: composer:v2 | |
coverage: xdebug | |
- name: Install Dependencies | |
working-directory: ${{ env.DIRECTORY }} | |
run: composer install -q --no-ansi --no-interaction --no-suggest --no-scripts --no-progress --prefer-dist --optimize-autoloader | |
- name: PHP cs fixer | |
working-directory: ${{ env.DIRECTORY }} | |
run: composer cs | |
- name: PHPStan | |
working-directory: ${{ env.DIRECTORY }} | |
run: composer ps | |
- name: Create database | |
working-directory: ${{ env.DIRECTORY }} | |
run: php bin/console doc:database:create --no-interaction -e test | |
- name: Migrate database | |
working-directory: ${{ env.DIRECTORY }} | |
run: php bin/console doc:mig:mig --no-interaction -e test | |
- name: Exec tests | |
working-directory: ${{ env.DIRECTORY }} | |
run: composer tuci | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
file: ${{ format('{0}/coverage.xml', env.DIRECTORY) }} | |
flags: backend | |
token: ${{ secrets.CODECOV_TOKEN }} |