diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..15fc483 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,83 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Tests" + +on: + pull_request: + push: + branches: + - "1.x" + +concurrency: + group: tests-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches + cancel-in-progress: true + +jobs: + tests-integration: + name: "Integration tests" + runs-on: "ubuntu-latest" + timeout-minutes: 30 + + + strategy: + fail-fast: false + matrix: + extension-name: + - "phpstan-doctrine" + #- "phpstan-phpunit" + #- "phpstan-mockery" + #- "phpstan-symfony" + #- "phpstan-nette" + #- "phpstan-webmozart-assert" + #- "phpstan-beberlei-assert" + #- "phpstan-deprecation-rules" + #- "phpstan-dibi" + #- "phpstan-strict-rules" + #- "phpstan-src" + + steps: + - name: "Checkout extension" + uses: actions/checkout@v5 + with: + repository: "phpstan/${{ matrix.extension-name }}" + + - name: "Checkout build-infection" + uses: actions/checkout@v5 + with: + path: "build-infection" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "8.3" + tools: "infection:0.31.7" + + - name: "Install build-infection dependencies" + working-directory: "build-infection" + run: "composer install --no-interaction --no-progress" + + - name: "Install dependencies" + run: "composer install --no-interaction --no-progress" + + - name: "Configure infection" + run: | + php build-infection/bin/infection-config.php \ + > infection.json5 + cat infection.json5 | jq + + - name: "Cache Result cache" + uses: actions/cache@v4 + with: + path: ./tmp + key: "result-cache-v1-${{ matrix.extension-name }}-${{ github.run_id }}" + restore-keys: | + result-cache-v1-${{ matrix.extension-name }}- + + - name: "Run infection" + run: | + infection \ + --ignore-msi-with-no-mutations \ + --log-verbosity=all \ + --debug \ + --logger-text=php://stdout