Skip to content

Updated dependencies #474

Updated dependencies

Updated dependencies #474

Workflow file for this run

name: Dependencies and Tests
on:
push:
branches: [ master, feature/** ]
pull_request:
branches: [ master ]
jobs:
build:
name: Symfony (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: juvem
MYSQL_DATABASE: juvem
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: exif, json, ctype, fileinfo, iconv, intl, mbstring, xml, xmlwriter, pdo, mysql, zip
coverage: xdebug #optional
- name: Start database service
run: sudo /etc/init.d/mysql start
- name: Install jre
run: sudo apt-get update -qq && sudo apt-get -q -y install openjdk-8-jre openjdk-8-jre-headless
- name: Install libreoffice
run: sudo apt-get -q -y install libreoffice-core libreoffice-writer libreoffice-java-common --no-install-recommends
- name: Ensure home config is available for user
run: chown -R --reference="$HOME" ~/.config
- name: Ensure home config is available for root
run: sudo chown -R --reference="$HOME" ~/.config
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer --working-dir=app config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/app/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Validate Composer files
run: composer validate --working-dir=app
- name: Copy testing parameters config
run: cp app/config/parameters.yml.test var/config/parameters.yml
- name: Insert database port number in config file
run: echo " database_port${{':'}} ${{ job.services.mysql.ports['3306'] }}" >> var/config/parameters.yml
- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader --working-dir=app
- name: Run Migration
run: |
php app/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
php app/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
- name: Copy test config
run: cp phpunit.xml.dist phpunit.xml
- name: Run Tests
run: php app/bin/phpunit --coverage-text --coverage-clover ./phpunit-result-clover.xml
- uses: actions/upload-artifact@v2
with:
name: phpunit-result-clover
path: ./phpunit-result-clover.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./phpunit-result-clover.xml
flags: unittests
name: clover-coverage
fail_ci_if_error: false
- name: Upload coverage to codeclimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: |
./phpunit-result-clover.xml:clover