chore(deps): update dependency phpunit/phpunit to v11 #423
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 workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: PR | |
on: | |
pull_request: | |
branches: [ main ] | |
push: | |
branches: [ main ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
operating-system: [ubuntu-latest] | |
php-version: ['8.0', '8.1', '8.2'] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: xdebug | |
extensions: ast | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Cache Composer packages | |
id: root-composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-${{ matrix.php-version }}-php-${{ hashFiles('composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.php-version }}-php- | |
- name: Install dependencies | |
if: steps.root-composer-cache.outputs.cache-hit != 'true' | |
run: composer install --prefer-dist --no-progress | |
- name: Check Style | |
run: vendor/bin/phpcs | |
- name: Run Psalm | |
run: vendor/bin/psalm --output-format=github --php-version=${{ matrix.php-version }} | |
- name: Run Phpstan | |
run: vendor/bin/phpstan analyse --error-format=github | |
- name: Run PHPUnit (unit tests) | |
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml --testsuite=unit | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
- name: Validate composer.json and composer.lock | |
working-directory: integration | |
run: composer validate | |
- name: Prepare test-harness | |
working-directory: integration | |
# this only supports the evaluation feature currently | |
# caching will be supported in a future release | |
run: | | |
git submodule update --init --recursive | |
cp ./test-harness/features/evaluation.feature ./features/ | |
- name: Cache Composer packages | |
id: behat-composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: integration/vendor | |
key: ${{ runner.os }}-${{ matrix.php-version }}-php-${{ hashFiles('integration/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.php-version }}-php- | |
- name: Install dependencies | |
working-directory: integration | |
if: steps.behat-composer-cache.outputs.cache-hit != 'true' | |
run: composer install --prefer-dist --no-progress | |
- name: Start test-harness container | |
run: docker run --rm -d -p 8013:8013 ghcr.io/open-feature/flagd-testbed:latest | |
- name: Run Behat (integration tests) | |
working-directory: integration | |
run: vendor/bin/behat |