67 lines
2.2 KiB
YAML
67 lines
2.2 KiB
YAML
name: Run Test Suite
|
|
on:
|
|
push:
|
|
branch-ignore:
|
|
- 'master'
|
|
- 'release/**'
|
|
pull_request:
|
|
jobs:
|
|
integration_tests:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
|
|
services:
|
|
mysql:
|
|
image: mysql:5.7
|
|
env:
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
MYSQL_DATABASE: panel_test
|
|
ports:
|
|
- 3306
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php: [7.4, 8.0]
|
|
name: PHP ${{ matrix.php }}
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
- name: get cache directory
|
|
id: composer-cache
|
|
run: |
|
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
- name: cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.php_cs.cache
|
|
${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cache-${{ matrix.php }}-
|
|
- name: setup
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
extensions: cli, openssl, gd, mysql, pdo, mbstring, tokenizer, bcmath, xml, curl, zip
|
|
tools: composer:v2
|
|
coverage: none
|
|
- name: configure
|
|
run: cp .env.ci .env
|
|
- name: install dependencies
|
|
run: composer install --prefer-dist --no-interaction --no-progress
|
|
- name: run cs-fixer
|
|
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --config .php_cs.dist
|
|
continue-on-error: true
|
|
- name: execute unit tests
|
|
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit
|
|
if: ${{ always() }}
|
|
env:
|
|
DB_CONNECTION: testing
|
|
TESTING_DB_HOST: UNIT_NO_DB
|
|
- name: execute integration tests
|
|
run: vendor/bin/phpunit tests/Integration
|
|
if: ${{ always() }}
|
|
env:
|
|
TESTING_DB_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
TESTING_DB_USERNAME: root
|