-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PHP 8.1 tests + minor pipeline enhancements (#83)
- Loading branch information
1 parent
f302862
commit 3d47b9a
Showing
6 changed files
with
54 additions
and
84 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 |
---|---|---|
|
@@ -12,7 +12,6 @@ jobs: | |
|
||
env: | ||
extensions: pdo, pdo_pgsql | ||
key: cache-v1 | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
|
@@ -22,45 +21,32 @@ jobs: | |
- ubuntu-latest | ||
|
||
php: | ||
- "7.4" | ||
- "8.0" | ||
- 7.4 | ||
- 8.0 | ||
- 8.1 | ||
|
||
pgsql: | ||
- "9" | ||
- "10" | ||
- "11" | ||
- "12" | ||
- "13" | ||
- 9 | ||
- 10 | ||
- 11 | ||
- 12 | ||
- 13 | ||
- 14 | ||
|
||
services: | ||
postgres: | ||
image: postgres:${{ matrix.pgsql }} | ||
env: | ||
POSTGRES_USER: scrutinizer | ||
POSTGRES_PASSWORD: scrutinizer | ||
POSTGRES_DB: scrutinizer | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: root | ||
POSTGRES_DB: yiitest | ||
ports: | ||
- 5432:5432 | ||
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Setup cache environment | ||
id: cache-env | ||
uses: shivammathur/cache-extensions@v1 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: ${{ env.extensions }} | ||
key: ${{ env.key }} | ||
|
||
- name: Cache extensions | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.cache-env.outputs.dir }} | ||
key: ${{ steps.cache-env.outputs.key }} | ||
restore-keys: ${{ steps.cache-env.outputs.key }} | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP with extensions | ||
uses: shivammathur/setup-php@v2 | ||
|
@@ -71,43 +57,15 @@ jobs: | |
coverage: pcov | ||
tools: composer:v2 | ||
|
||
- name: Determine composer cache directory on Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
- name: Determine composer cache directory | ||
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | ||
|
||
- name: Determine composer cache directory on Windows | ||
if: matrix.os == 'windows-latest' | ||
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
||
- name: Cache dependencies installed with composer | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
php${{ matrix.php }}-composer- | ||
- name: Update composer | ||
run: composer self-update | ||
|
||
- name: Install dependencies with composer php 7.4 | ||
if: matrix.php == '7.4' | ||
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
|
||
- name: Install dependencies with composer php 8.0 | ||
if: matrix.php == '8.0' | ||
- name: Install dependencies with composer | ||
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
|
||
- name: Run tests with phpunit and coverage on Linux php 7.4 | ||
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4' | ||
run: vendor/bin/phpunit --coverage-clover=coverage.clover --colors=always | ||
|
||
- name: Run tests with phpunit without coverage | ||
if: matrix.os != 'ubuntu-latest' || matrix.php != '7.4' | ||
- name: Run tests with phpunit | ||
run: vendor/bin/phpunit --colors=always | ||
|
||
- name: Code coverage | ||
if: matrix.php == '7.4' | ||
run: | | ||
wget https://scrutinizer-ci.com/ocular.phar | ||
php ocular.phar code-coverage:upload --access-token=${{secrets.SCRUTINIZER}} --format=php-clover coverage.clover |
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
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
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
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
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