Skip to content

Isolated tests

Isolated tests #62

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"