Skip to content

Commit 5fe2730

Browse files
committed
Restructure things
1 parent fbea08a commit 5fe2730

File tree

2 files changed

+64
-53
lines changed

2 files changed

+64
-53
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
php-version: [ '7.2', '7.3', '7.4' ]
42+
php-version: [ '7.2', '7.3' ]
43+
coverage: [ 'none' ]
44+
include:
45+
- php-version: '7.4'
46+
coverage: none
4347

4448
steps:
4549
- name: Checkout
@@ -51,7 +55,7 @@ jobs:
5155
php-version: ${{ matrix.php-version }}
5256
ini-values: error_reporting=E_ALL
5357
tools: composer:v2
54-
coverage: none
58+
coverage: "${{ matrix.coverage }}"
5559

5660
- name: Show the Composer configuration
5761
run: composer config --global --list
@@ -70,57 +74,7 @@ jobs:
7074
composer show;
7175
7276
- name: Run Tests
73-
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
74-
75-
coverage:
76-
name: Coverage
77-
78-
runs-on: ubuntu-22.04
79-
80-
needs: [ php-lint ]
81-
82-
strategy:
83-
fail-fast: false
84-
matrix:
85-
php-version: [ '7.4' ]
86-
87-
steps:
88-
- name: Checkout
89-
uses: actions/checkout@v4
90-
91-
- name: Install PHP
92-
uses: shivammathur/setup-php@v2
93-
with:
94-
php-version: ${{ matrix.php-version }}
95-
ini-values: error_reporting=E_ALL
96-
tools: composer:v2
97-
coverage: xdebug
98-
99-
- name: Show the Composer configuration
100-
run: composer config --global --list
101-
102-
- name: Cache dependencies installed with composer
103-
uses: actions/cache@v4
104-
with:
105-
path: ~/.cache/composer
106-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
107-
restore-keys: |
108-
php${{ matrix.php-version }}-composer-
109-
110-
- name: Install Composer dependencies
111-
run: |
112-
composer update --with-dependencies --no-progress;
113-
composer show;
114-
115-
- name: Run Tests
116-
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
117-
118-
- name: Upload coverage results to Codacy
119-
env:
120-
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
121-
if: "${{ env.CODACY_PROJECT_TOKEN != '' }}"
122-
run: |
123-
./vendor/bin/codacycoverage clover build/coverage/xml
77+
run: ./vendor/bin/phpunit
12478

12579
static-analysis:
12680
name: Static Analysis

.github/workflows/codecoverage.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
name: Code coverage
10+
11+
jobs:
12+
code-coverage:
13+
name: Code coverage
14+
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
matrix:
19+
php-version: [ '7.4' ]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
ini-values: error_reporting=E_ALL
30+
tools: composer:v2
31+
coverage: xdebug
32+
33+
- name: Show the Composer configuration
34+
run: composer config --global --list
35+
36+
- name: Cache dependencies installed with composer
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cache/composer
40+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: |
42+
php${{ matrix.php-version }}-composer-
43+
44+
- name: Install Composer dependencies
45+
run: |
46+
composer update --with-dependencies --no-progress;
47+
composer show;
48+
49+
- name: Run Tests
50+
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
51+
52+
- name: Upload coverage results to Codacy
53+
env:
54+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
55+
if: "${{ env.CODACY_PROJECT_TOKEN != '' }}"
56+
run: |
57+
./vendor/bin/codacycoverage clover build/coverage/xml

0 commit comments

Comments
 (0)