chore(deps): pin dependencies #87
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
name: Tests | |
on: | |
push: | |
pull_request: | |
types: [opened] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php_version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
- '8.4' | |
name: PHP ${{ matrix.php_version }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup PHP with pecl extension | |
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2 | |
with: | |
php-version: ${{ matrix.php_version }} | |
tools: 'infection' | |
ini-values: zend.assertions=1,assert.exception=1,assert.active=1 | |
coverage: pcov | |
- run: composer install | |
- run: vendor/bin/phpunit --coverage-clover phpunit/phpunit.coverage.xml --coverage-xml phpunit/coverage-xml --log-junit phpunit/junit.xml | |
- run: infection --threads=4 --logger-github --coverage=phpunit | |
if: matrix.php_version != '8.1' | |
env: | |
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} | |
- name: Set repository name | |
id: repository-name | |
run: > | |
echo "REPOSITORY_NAME=$(echo $GITHUB_REPOSITORY | tr '/' '_')" >> "$GITHUB_OUTPUT" ; | |
echo "REPOSITORY_OWNER=$(echo $GITHUB_REPOSITORY | cut -d'/' -f1)" >> "$GITHUB_OUTPUT" | |
- name: fix code coverage paths | |
working-directory: ./phpunit | |
run: | | |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' phpunit.coverage.xml | |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' junit.xml | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@db501078e936e4b4c8773d1bb949ba9ddb7b6b6a # v1.9 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: | |
-Dsonar.projectKey=${{ steps.repository-name.outputs.REPOSITORY_NAME }} | |
-Dsonar.organization=${{ steps.repository-name.outputs.REPOSITORY_OWNER }} | |
-Dsonar.sources=src | |
-Dsonar.tests=tests | |
-Dsonar.php.coverage.reportPaths=phpunit/phpunit.coverage.xml | |
-Dsonar.php.tests.reportPath=phpunit/junit.xml |