Skip to content

Commit d623a29

Browse files
committed
Restructure things
1 parent 88aadf3 commit d623a29

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
@@ -41,7 +41,11 @@ jobs:
4141
strategy:
4242
fail-fast: false
4343
matrix:
44-
php-version: [ '7.2', '7.3', '7.4' ]
44+
php-version: [ '7.2', '7.3' ]
45+
coverage: [ 'none' ]
46+
include:
47+
- php-version: '7.4'
48+
coverage: none
4549

4650
steps:
4751
- name: Checkout
@@ -53,7 +57,7 @@ jobs:
5357
php-version: ${{ matrix.php-version }}
5458
ini-values: error_reporting=E_ALL
5559
tools: composer:v2
56-
coverage: none
60+
coverage: "${{ matrix.coverage }}"
5761

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

12781
static-analysis:
12882
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)