-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45b2112
commit 6dc7ff4
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
php: ['8.2'] | ||
os: ['ubuntu-20.04'] | ||
include: | ||
- php: '8.1' | ||
os: 'ubuntu-latest' | ||
- php: '8.0' | ||
os: 'ubuntu-20.04' | ||
- php: '7.4' | ||
os: 'ubuntu-20.04' | ||
fail-fast: false | ||
env: | ||
COVERAGE_CACHE_PATH: phpunit-coverage-cache | ||
PHP_VERSION: ${{ matrix.php }} | ||
|
||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 | ||
|
||
- name: Switch to PHP ${{ env.PHP_VERSION }} | ||
run: | | ||
sudo update-alternatives --set php /usr/bin/php$PHP_VERSION | ||
sudo update-alternatives --set phar /usr/bin/phar$PHP_VERSION | ||
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$PHP_VERSION | ||
sudo update-alternatives --set phpize /usr/bin/phpize$PHP_VERSION | ||
sudo update-alternatives --set php-config /usr/bin/php-config$PHP_VERSION | ||
- name: Enable pcov | ||
run: | | ||
sudo phpdismod xdebug | ||
sudo phpenmod pcov | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install Dependencies | ||
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
|
||
- name: Execute tests (Unit tests) via Codeception | ||
run: | | ||
vendor/bin/codeception run unit |