|
1 | | -name: CI Pipeline |
| 1 | +name: "Continuous Integration" |
| 2 | + |
2 | 3 | on: |
3 | 4 | pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'refs/pull/*' |
4 | 8 |
|
5 | 9 | jobs: |
6 | | - |
7 | | - coding-standard: |
8 | | - |
9 | | - name: "Coding Standard" |
10 | | - |
11 | | - runs-on: "${{ matrix.operating-system }}" |
12 | | - |
13 | | - strategy: |
14 | | - fail-fast: true |
15 | | - matrix: |
16 | | - operating-system: ['ubuntu-latest'] |
17 | | - php-version: ['7.4'] |
18 | | - |
19 | | - steps: |
20 | | - - name: Checkout |
21 | | - uses: actions/checkout@v2 |
22 | | - |
23 | | - - name: Setup PHP |
24 | | - uses: shivammathur/setup-php@v2 |
25 | | - with: |
26 | | - php-version: ${{ matrix.php-version }} |
27 | | - tools: "composer:v2" |
28 | | - |
29 | | - - name: Install dependencies |
30 | | - run: composer install --no-progress --prefer-dist --optimize-autoloader |
31 | | - |
32 | | - - name: Check codestyle |
33 | | - run: vendor/bin/phpcs -s |
34 | | - |
35 | | - static-analysis: |
36 | | - name: "Static Analysis" |
37 | | - runs-on: "${{ matrix.operating-system }}" |
38 | | - |
39 | | - strategy: |
40 | | - fail-fast: true |
41 | | - matrix: |
42 | | - php-version: ['7.4'] |
43 | | - operating-system: ['ubuntu-latest'] |
44 | | - |
| 10 | + matrix: |
| 11 | + name: Generate job matrix |
| 12 | + runs-on: ubuntu-latest |
| 13 | + outputs: |
| 14 | + matrix: ${{ steps.matrix.outputs.matrix }} |
45 | 15 | steps: |
46 | | - - name: Checkout |
47 | | - uses: actions/checkout@v2 |
48 | | - |
49 | | - - name: Setup PHP |
50 | | - uses: shivammathur/setup-php@v2 |
51 | | - with: |
52 | | - php-version: ${{ matrix.php-version }} |
53 | | - tools: "composer:v2" |
54 | | - |
55 | | - - name: Install dependencies |
56 | | - run: composer install --no-progress --prefer-dist --optimize-autoloader |
57 | | - |
58 | | - - name: Analyze code with static-analysis |
59 | | - run: vendor/bin/psalm --shepherd |
60 | | - |
61 | | - unit-tests: |
62 | | - name: "Unit Tests" |
63 | | - |
64 | | - runs-on: "${{ matrix.operating-system }}" |
65 | | - continue-on-error: "${{ matrix.experimental }}" |
66 | | - |
| 16 | + - name: Gather CI configuration |
| 17 | + id: matrix |
| 18 | + uses: laminas/laminas-ci-matrix-action@v1 |
| 19 | + |
| 20 | + qa: |
| 21 | + name: QA Checks |
| 22 | + needs: [matrix] |
| 23 | + runs-on: ${{ matrix.operatingSystem }} |
67 | 24 | strategy: |
68 | 25 | fail-fast: false |
69 | | - matrix: |
70 | | - php-version: ["7.3", "7.4", "8.0"] |
71 | | - operating-system: ["ubuntu-latest", "macos-latest"] |
72 | | - experimental: [false] |
73 | | - composer-dependencies: ['lowest', 'latest'] |
74 | | - |
| 26 | + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} |
75 | 27 | steps: |
76 | | - - name: Checkout |
77 | | - uses: actions/checkout@v2 |
78 | | - |
79 | | - - name: Setup PHP |
80 | | - uses: shivammathur/setup-php@v2 |
81 | | - with: |
82 | | - php-version: ${{ matrix.php-version }} |
83 | | - tools: "composer:v2" |
84 | | - |
85 | | - - name: Install dependencies |
86 | | - run: composer install --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-options }} |
87 | | - |
88 | | - - name: Ensure lowest dependencies |
89 | | - if: ${{ matrix.composer-dependencies == 'lowest' }} |
90 | | - run: composer update --no-progress --prefer-dist --prefer-lowest ${{ matrix.composer-options }} |
91 | | - |
92 | | - - name: Execute tests |
93 | | - run: vendor/bin/phpunit --colors=always --coverage-clover=build/coverage-clover.xml --coverage-xml=build/coverage-xml --log-junit build/coverage-junit.xml --coverage-text |
94 | | - |
95 | | - - name: "Publish Coverage Report to Codecov" |
96 | | - uses: "codecov/codecov-action@v1" |
| 28 | + - name: ${{ matrix.name }} |
| 29 | + uses: laminas/laminas-continuous-integration-action@v1 |
97 | 30 | with: |
98 | | - file: ./build/coverage-clover.xml |
| 31 | + job: ${{ matrix.job }} |
0 commit comments