Skip to content

Isolated Tests

Isolated Tests #92

name: Isolated Tests
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
get_packages:
name: Get Packages
runs-on: ubuntu-latest
steps:
- name: Set Up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
coverage: none
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get Packages
id: get_json
run: echo "json=$(bin/get-packages)" >> $GITHUB_OUTPUT
- name: Output Packages
run: echo "${{ steps.get_json.outputs.json }}"
outputs:
matrix: ${{ steps.get_json.outputs.json }}
phpunit:
runs-on: ${{ matrix.os }}
needs: get_packages
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
package: ${{ fromJson(needs.get_packages.outputs.matrix) }}
php:
- 8.4
stability:
- prefer-stable
- prefer-lowest
name: "Run Tests: ${{ matrix.package.name }} - PHP ${{ matrix.php }} - ${{ matrix.stability }}"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, pcntl, fileinfo
tools: phpunit
coverage: pcov
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
./bin/build-changed-packages
cd "src/Tempest/${{ matrix.package.basename }}"
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: phpunit -c "src/Tempest/${{ matrix.package.basename }}/phpunit.xml"