|
1 | 1 | name: "Continuous Integration" |
2 | 2 |
|
| 3 | +# Branch protection blocks direct pushes to release branches, and pull_request |
| 4 | +# already re-triggers on every commit pushed to a PR branch (synchronize), so |
| 5 | +# there's no push:branches trigger here — only PRs (targeting numbered |
| 6 | +# release branches) and pushed version tags. |
3 | 7 | on: |
4 | 8 | pull_request: |
5 | | - push: |
6 | 9 | branches: |
| 10 | + - "[0-9]+.[0-9]+.x" |
| 11 | + push: |
7 | 12 | tags: |
| 13 | + - "[0-9]+.[0-9]+.[0-9]+" |
8 | 14 |
|
9 | 15 | jobs: |
10 | | - matrix: |
11 | | - name: Generate job matrix |
12 | | - runs-on: ubuntu-latest |
13 | | - outputs: |
14 | | - matrix: ${{ steps.matrix.outputs.matrix }} |
15 | | - steps: |
16 | | - - name: Gather CI configuration |
17 | | - id: matrix |
18 | | - uses: laminas/laminas-ci-matrix-action@v1 |
19 | | - |
20 | 16 | qa: |
21 | | - name: QA Checks |
22 | | - needs: [matrix] |
23 | | - runs-on: ${{ matrix.operatingSystem }} |
24 | | - strategy: |
25 | | - fail-fast: false |
26 | | - matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} |
27 | | - steps: |
28 | | - - name: ${{ matrix.name }} |
29 | | - uses: laminas/laminas-continuous-integration-action@v1 |
30 | | - with: |
31 | | - job: ${{ matrix.job }} |
32 | | - services: |
33 | | - postgres: |
34 | | - image: postgres |
35 | | - env: |
36 | | - POSTGRES_PASSWORD: 'password' |
37 | | - POSTGRES_DB: 'phpdb_test' |
38 | | - options: >- |
39 | | - --health-cmd pg_isready |
40 | | - --health-interval 10s |
41 | | - --health-timeout 5s |
42 | | - --health-retries 3 |
43 | | - ports: |
44 | | - - 5432 |
| 17 | + uses: php-db/phpdb-qa-tools/.github/workflows/continuous-integration.yml@0.1.x |
| 18 | + # CODECOV_TOKEN (org-wide) and INFECTION_DASHBOARD_API_KEY (per-repo) both |
| 19 | + # come through here, whichever scope actually defines each one. |
| 20 | + secrets: inherit |
| 21 | + with: |
| 22 | + php-versions: '["8.3", "8.4", "8.5"]' |
| 23 | + run-integration: true |
| 24 | + # Postgres container for the integration suite; the schema itself is |
| 25 | + # seeded by the ListenerExtension PHPUnit bootstrap, not this workflow. |
| 26 | + db-image: "postgres:17-alpine" |
| 27 | + db-port: "5432" |
| 28 | + db-env-json: '{"POSTGRES_DB":"phpdb_test","POSTGRES_USER":"postgres","POSTGRES_PASSWORD":"password"}' |
| 29 | + db-health-cmd: "pg_isready -U postgres -d phpdb_test" |
| 30 | + # The test/mutation-test jobs run directly on the runner VM (no |
| 31 | + # container:), so the DB is only reachable via 127.0.0.1 + the mapped |
| 32 | + # port, not the container name. phpunit.xml.dist defaults this to |
| 33 | + # "postgres" for local Docker Compose dev (container-to-container); this |
| 34 | + # overrides it for CI without touching that file. |
| 35 | + test-env-json: '{"TESTS_PHPDB_PGSQL_HOSTNAME":"127.0.0.1"}' |
| 36 | + enable-codecov: true |
| 37 | + enable-infection: true |
| 38 | + # Canonical leg for coverage + mutation testing (highest supported PHP). |
| 39 | + coverage-php-version: "8.5" |
0 commit comments