|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | tests: |
9 | | - name: Tests (PHP ${{ matrix.php-version }} & ${{ matrix.dependencies }} dependencies) |
10 | | - runs-on: ubuntu-latest |
11 | | - strategy: |
12 | | - fail-fast: false |
13 | | - matrix: |
14 | | - php-version: ["8.1", "8.2", "8.3", "8.4"] |
15 | | - dependencies: ["highest", "lowest"] |
16 | | - steps: |
17 | | - - uses: actions/checkout@v4 |
18 | | - with: |
19 | | - fetch-depth: 0 |
20 | | - |
21 | | - # Prepare environment |
22 | | - - name: Setup PHP |
23 | | - uses: shivammathur/setup-php@v2 |
24 | | - with: |
25 | | - php-version: ${{ matrix.php-version }} |
26 | | - tools: composer:v2 |
27 | | - coverage: none |
28 | | - |
29 | | - # Install dependencies |
30 | | - - name: Install Composer dependencies |
31 | | - uses: ramsey/composer-install@v3 |
32 | | - with: |
33 | | - dependency-versions: ${{ matrix.dependencies }} |
34 | | - |
35 | | - # Run tests |
36 | | - - name: Run tests |
37 | | - run: composer test |
38 | | - |
39 | | - coverage: |
40 | | - name: Test coverage |
41 | | - runs-on: ubuntu-latest |
42 | | - steps: |
43 | | - - uses: actions/checkout@v4 |
44 | | - with: |
45 | | - fetch-depth: 0 |
46 | | - |
47 | | - # Prepare environment |
48 | | - - name: Setup PHP |
49 | | - uses: shivammathur/setup-php@v2 |
50 | | - with: |
51 | | - php-version: 8.4 |
52 | | - tools: composer:v2 |
53 | | - coverage: pcov |
54 | | - |
55 | | - # Install dependencies |
56 | | - - name: Install Composer dependencies |
57 | | - uses: ramsey/composer-install@v3 |
58 | | - |
59 | | - # Run tests |
60 | | - - name: Build coverage directory |
61 | | - run: mkdir -p .build/coverage |
62 | | - - name: Run tests with coverage |
63 | | - run: composer test:coverage |
64 | | - |
65 | | - # Upload artifact |
66 | | - - name: Fix coverage path |
67 | | - working-directory: .build/coverage |
68 | | - run: sed -i 's#/home/runner/work/php-cs-fixer-config/php-cs-fixer-config#${{ github.workspace }}#g' clover.xml |
69 | | - - name: Upload coverage artifact |
70 | | - uses: actions/upload-artifact@v4 |
71 | | - with: |
72 | | - name: coverage |
73 | | - path: .build/coverage/clover.xml |
74 | | - retention-days: 7 |
75 | | - |
76 | | - coverage-report: |
77 | | - name: Report test coverage |
78 | | - runs-on: ubuntu-latest |
79 | | - needs: coverage |
80 | | - steps: |
81 | | - - uses: actions/checkout@v4 |
82 | | - with: |
83 | | - fetch-depth: 0 |
84 | | - |
85 | | - # Download artifact |
86 | | - - name: Download coverage artifact |
87 | | - id: download |
88 | | - uses: actions/download-artifact@v5 |
89 | | - with: |
90 | | - name: coverage |
91 | | - |
92 | | - # CodeClimate |
93 | | - - name: CodeClimate report |
94 | | - uses: paambaati/codeclimate-action@v9.0.0 |
95 | | - if: env.CC_TEST_REPORTER_ID |
96 | | - env: |
97 | | - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
98 | | - with: |
99 | | - coverageLocations: | |
100 | | - ${{ steps.download.outputs.download-path }}/clover.xml:clover |
101 | | -
|
102 | | - # Coveralls |
103 | | - - name: Coveralls report |
104 | | - uses: coverallsapp/github-action@v2 |
105 | | - with: |
106 | | - file: ${{ steps.download.outputs.download-path }}/clover.xml |
| 9 | + uses: jackd248/reusable-github-actions/.github/workflows/tests-php.yml@main |
0 commit comments