|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - '**' |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +jobs: |
| 14 | + prepare: |
| 15 | + name: 'Prepare workflow' |
| 16 | + uses: eliashaeussler/gha/.github/workflows/preparation.yaml@main |
| 17 | + |
| 18 | + cgl: |
| 19 | + name: 'Check coding guidelines' |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + needs: [prepare] |
| 23 | + if: ${{ needs.prepare.outputs.continue == 'true' }} |
| 24 | + |
| 25 | + permissions: |
| 26 | + security-events: write |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 30 | + with: |
| 31 | + persist-credentials: false |
| 32 | + |
| 33 | + # Composer |
| 34 | + - name: Setup PHP |
| 35 | + uses: eliashaeussler/gha/.github/actions/setup-php@main |
| 36 | + with: |
| 37 | + # We use the minimum supported PHP version |
| 38 | + php-version: 8.2 # renovate-ignore |
| 39 | + - name: Install Composer packages |
| 40 | + uses: eliashaeussler/gha/.github/actions/composer-install@main |
| 41 | + - name: Perform Composer checks |
| 42 | + uses: eliashaeussler/gha/.github/actions/composer-checks@main |
| 43 | + |
| 44 | + # npm |
| 45 | + - name: Setup Node |
| 46 | + uses: eliashaeussler/gha/.github/actions/setup-node@main |
| 47 | + - name: Install npm packages |
| 48 | + uses: eliashaeussler/gha/.github/actions/npm-install@main |
| 49 | + - name: Perform npm checks |
| 50 | + uses: eliashaeussler/gha/.github/actions/npm-checks@main |
| 51 | + |
| 52 | + # Zizmor |
| 53 | + - name: Run zizmor |
| 54 | + uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6 |
| 55 | + |
| 56 | + unit-tests: |
| 57 | + name: 'Unit tests (PHP ${{ matrix.php-version }}, ${{ matrix.os }} & ${{ matrix.dependencies }} dependencies)' |
| 58 | + runs-on: ${{ matrix.os }}-latest |
| 59 | + |
| 60 | + needs: [prepare] |
| 61 | + if: ${{ needs.prepare.outputs.continue == 'true' }} |
| 62 | + |
| 63 | + strategy: |
| 64 | + fail-fast: false |
| 65 | + matrix: |
| 66 | + php-version: ["8.2", "8.3", "8.4", "8.5"] |
| 67 | + dependencies: ["highest", "lowest"] |
| 68 | + os: ["Ubuntu"] |
| 69 | + include: |
| 70 | + - php-version: "8.5" |
| 71 | + dependencies: "highest" |
| 72 | + os: "macOS" |
| 73 | + - php-version: "8.5" |
| 74 | + dependencies: "highest" |
| 75 | + os: "Windows" |
| 76 | + |
| 77 | + uses: eliashaeussler/gha/.github/workflows/composer-tests.yaml@main |
| 78 | + with: |
| 79 | + php-version: ${{ matrix.php-version }} |
| 80 | + dependencies: ${{ matrix.dependencies }} |
| 81 | + command: 'test:unit' |
| 82 | + |
| 83 | + e2e-tests: |
| 84 | + name: 'E2E tests' |
| 85 | + |
| 86 | + needs: [prepare] |
| 87 | + if: ${{ needs.prepare.outputs.continue == 'true' }} |
| 88 | + |
| 89 | + uses: eliashaeussler/gha/.github/workflows/composer-tests.yaml@main |
| 90 | + with: |
| 91 | + command: 'test:e2e' |
| 92 | + |
| 93 | + test-coverage: |
| 94 | + name: 'Test coverage' |
| 95 | + |
| 96 | + needs: [prepare] |
| 97 | + if: ${{ needs.prepare.outputs.continue == 'true' }} |
| 98 | + |
| 99 | + uses: eliashaeussler/gha/.github/workflows/composer-test-coverage.yaml@main |
0 commit comments