diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml deleted file mode 100644 index 1387adc..0000000 --- a/.github/workflows/codacy.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Code Quality Analysis - -on: [ push, pull_request ] - -jobs: - build-test: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up php 8.1 - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - - - 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 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..cd60f21 --- /dev/null +++ b/.github/workflows/testing.yml @@ -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