-
Notifications
You must be signed in to change notification settings - Fork 10
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
2 changed files
with
61 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# ____ _ _ | ||
# / ___|| |_ _ _ __| | ___ ___ | ||
# \___ \| __| | | |/ _` |/ _ \ / _ \ | ||
# ___) | |_| |_| | (_| | (_) | (_) | | ||
# |____/ \__|\__,_|\__,_|\___/ \___/ | ||
# | ||
# Fichier de test de la qualité du code avec Codacy | ||
# | ||
name: Code Quality Analysis | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
eduframe: | ||
name: EduFrame -> Test PHP (PHP ${{ matrix.php-versions }}) | ||
# https://hub.docker.com/_/ubuntu/ | ||
runs-on: ubuntu-latest | ||
services: | ||
mysql: | ||
# https://hub.docker.com/_/mariadb | ||
image: mysql:8.0 | ||
env: | ||
MYSQL_USER: app_db | ||
MYSQL_PASSWORD: 'root' | ||
MYSQL_ROOT_PASSWORD: root | ||
ports: | ||
- 3306:3306 | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php-versions: [ '8.1' ] | ||
steps: | ||
# https://github.com/actions/checkout (official) | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# https://github.com/shivammathur/setup-php (community) | ||
- name: Setup PHP, extensions and composer with shivammathur/setup-php | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo, curl | ||
- name: Check PHP Version | ||
run: php -v | ||
|
||
- name: Install .env | ||
run: mv .env.example .env | ||
|
||
- name: Install dependencies | ||
run: composer self-update && composer install && composer dump-autoload | ||
|
||
- name: Run tests and collect coverage | ||
run: vendor/bin/phpunit --coverage-clover clover.xml | ||
|
||
- name: Upload coverage to Codacy | ||
run: | | ||
export CODACY_API_TOKEN=${{ secrets.CODACY_API_TOKEN }} | ||
export CODACY_ORGANIZATION_PROVIDER=gh | ||
export CODACY_USERNAME=studoo-app | ||
export CODACY_PROJECT_NAME=edu-framework | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r clover.xml |