Skip to content

Commit 42501d3

Browse files
committed
Restructure things
1 parent c8f5c33 commit 42501d3

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,50 +39,11 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
php-version: [ '7.2', '7.3', '7.4' ]
43-
44-
steps:
45-
- name: Checkout
46-
uses: actions/checkout@v4
47-
48-
- name: Install PHP
49-
uses: shivammathur/setup-php@v2
50-
with:
51-
php-version: ${{ matrix.php-version }}
52-
ini-values: error_reporting=E_ALL
53-
tools: composer:v2
54-
coverage: none
55-
56-
- name: Show the Composer configuration
57-
run: composer config --global --list
58-
59-
- name: Cache dependencies installed with composer
60-
uses: actions/cache@v4
61-
with:
62-
path: ~/.cache/composer
63-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
64-
restore-keys: |
65-
php${{ matrix.php-version }}-composer-
66-
67-
- name: Install Composer dependencies
68-
run: |
69-
composer update --with-dependencies --no-progress;
70-
composer show;
71-
72-
- 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' ]
42+
php-version: [ '7.2', '7.3' ]
43+
coverage: [ 'none' ]
44+
include:
45+
- php-version: '7.4'
46+
coverage: none
8647

8748
steps:
8849
- name: Checkout
@@ -94,7 +55,7 @@ jobs:
9455
php-version: ${{ matrix.php-version }}
9556
ini-values: error_reporting=E_ALL
9657
tools: composer:v2
97-
coverage: xdebug
58+
coverage: "${{ matrix.coverage }}"
9859

9960
- name: Show the Composer configuration
10061
run: composer config --global --list
@@ -113,14 +74,7 @@ jobs:
11374
composer show;
11475
11576
- 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)