-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
64 additions
and
65 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,20 @@ | ||
name: backend | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
lint: | ||
lint-and-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
working-directory: ./backend | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
extensions: ctype, iconv, mbstring, mysql | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Install Dependencies | ||
working-directory: ./backend | ||
run: composer install -q --no-ansi --no-interaction --no-suggest --no-scripts --no-progress --prefer-dist | ||
|
||
- name: PHP cs fixer | ||
working-directory: ./backend | ||
run: composer cs | ||
|
||
- name: PHPStan | ||
working-directory: ./backend | ||
run: composer ps | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
needs: [lint] | ||
env: | ||
DATABASE_URL: "mysql://user1:[email protected]:${{ job.services.mariadb.ports['3306'] }}/auto_entreprise_test" | ||
DIRECTORY: ./backend | ||
|
||
services: | ||
mariadb_test: | ||
mariadb: | ||
image: mariadb:10.9 | ||
env: | ||
MYSQL_ROOT_PASSWORD: secret | ||
|
@@ -52,10 +27,10 @@ jobs: | |
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
working-directory: ./backend | ||
working-directory: ${{ env.DIRECTORY }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
|
@@ -64,17 +39,32 @@ jobs: | |
coverage: xdebug | ||
|
||
- name: Install Dependencies | ||
working-directory: ./backend | ||
run: composer install -q --no-ansi --no-interaction --no-suggest --no-scripts --no-progress --prefer-dist | ||
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: ./backend | ||
working-directory: ${{ env.DIRECTORY }} | ||
run: php bin/console doc:database:create --no-interaction -e test | ||
|
||
- name: Migrate database | ||
working-directory: ./backend | ||
working-directory: ${{ env.DIRECTORY }} | ||
run: php bin/console doc:mig:mig --no-interaction -e test | ||
|
||
- name: Exec tests | ||
working-directory: ./backend | ||
run: composer tuc | ||
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
name: frontend | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
lint-tests: | ||
lint-and-tests: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DIRECTORY: ./frontend | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install dependencies | ||
working-directory: ./frontend | ||
working-directory: ${{ env.DIRECTORY }} | ||
run: npm ci | ||
|
||
- name: Run prettier | ||
working-directory: ./frontend | ||
- name: Run format | ||
working-directory: ${{ env.DIRECTORY }} | ||
run: npm run format | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run eslint | ||
working-directory: ./frontend | ||
- name: Run lint | ||
working-directory: ${{ env.DIRECTORY }} | ||
run: npm run lint | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run jest | ||
working-directory: ./frontend | ||
- name: Run tests | ||
working-directory: ${{ env.DIRECTORY }} | ||
run: npm run test:cov | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run jest e2e | ||
working-directory: ./frontend | ||
run: npm run test:e2e | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ${{ format('{0}/coverage/clover.xml', env.DIRECTORY) }} | ||
flags: frontend | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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
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
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