You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
3.5 KiB
96 lines
3.5 KiB
name: PHPUnit 🐛
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
operating-system: [ubuntu-latest]
|
|
php-versions: ['8.0']
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup node
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install nodejs npm
|
|
|
|
- name: Setup PHP, with composer and extensions
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, gd, json, soap, zip, bcmath
|
|
ini-values: post_max_size=256M, max_execution_time=600, memory_limit=4096M, date.timezone=Europe/Paris
|
|
coverage: pcov
|
|
|
|
- name: Start mysql service
|
|
run: |
|
|
sudo /etc/init.d/mysql start
|
|
|
|
- name: Get composer cache directory
|
|
id: composer-cache
|
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache composer dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
# Use composer.json for key, if composer.lock is not committed.
|
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Install dependencies with composer
|
|
run: composer install --no-progress
|
|
|
|
- name: Install assets
|
|
run: php bin/console assets:install
|
|
|
|
- name: Install Yarn
|
|
run: |
|
|
sudo npm install -g yarn
|
|
yarn set version 2.4.2
|
|
yarn --version
|
|
|
|
- name: Check PHP settings
|
|
run: |
|
|
php -ini
|
|
php -v
|
|
php -m
|
|
|
|
- name: Install PHPUnit
|
|
run: vendor/bin/simple-phpunit --version
|
|
|
|
- name: Setup test database
|
|
run: |
|
|
php bin/console --env=test cache:clear
|
|
php bin/console --env=test doctrine:database:create
|
|
php bin/console --env=test doctrine:schema:create
|
|
php bin/console --env=test doctrine:fixtures:load --no-interaction
|
|
|
|
- name: Run PHPUnit tests
|
|
run: php bin/phpunit --coverage-clover clover.xml
|
|
|
|
- name: Coverage
|
|
uses: codecov/codecov-action@v2
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
|
files: ./clover.xml
|
|
name: codecov-umbrella # optional
|
|
fail_ci_if_error: false
|
|
verbose: true
|
|
|
|
- name: Upload coverage results to Coveralls
|
|
env:
|
|
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
composer global require php-coveralls/php-coveralls
|
|
sudo mkdir -p build/logs
|
|
sudo chmod -R 777 build
|
|
php-coveralls --coverage_clover=clover.xml -v
|
|
|