Skip to content

Commit 345f50d

Browse files
committed
Restructure things
1 parent 6dc97c9 commit 345f50d

File tree

2 files changed

+61
-53
lines changed

2 files changed

+61
-53
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -39,50 +39,10 @@ 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'
8646

8747
steps:
8848
- name: Checkout
@@ -94,7 +54,7 @@ jobs:
9454
php-version: ${{ matrix.php-version }}
9555
ini-values: error_reporting=E_ALL
9656
tools: composer:v2
97-
coverage: xdebug
57+
coverage: "${{ matrix.coverage }}"
9858

9959
- name: Show the Composer configuration
10060
run: composer config --global --list
@@ -113,14 +73,7 @@ jobs:
11373
composer show;
11474
11575
- 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
76+
run: ./vendor/bin/phpunit
12477

12578
static-analysis:
12679
name: Static Analysis

.github/workflows/codecoverage.yml

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

0 commit comments

Comments
 (0)