Skip to content

Commit

Permalink
Update workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 13, 2024
1 parent 91b44d7 commit 460b616
Showing 1 changed file with 7 additions and 65 deletions.
72 changes: 7 additions & 65 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,68 +23,10 @@ name: build

jobs:
phpunit:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- windows-latest

php:
- 8.1
- 8.2
- 8.3

exclude:
- os: windows-latest
php: 8.2

- os: windows-latest
php: 8.3

steps:
- name: Checkout.
uses: actions/checkout@v4

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
coverage: pcov
extensions: uopz
ini-values: date.timezone='UTC'
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Determine composer cache directory on Linux.
if: matrix.os == 'ubuntu-latest'
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@v4
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.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit with code coverage.
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always --configuration phpunit.xml.dist

- name: Upload coverage to Codecov.
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
with:
extensions: uopz
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.1', '8.2', '8.3']

0 comments on commit 460b616

Please sign in to comment.