Skip to content

Commit

Permalink
#43 new script CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoujols committed Dec 29, 2023
1 parent 3459cfe commit 7bf3b40
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 30 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/codacy.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/testing.yml
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

0 comments on commit 7bf3b40

Please sign in to comment.