Skip to content

Commit 663ed13

Browse files
author
Greg Bowler
committed
Upgrade test runners
1 parent 795a061 commit 663ed13

4 files changed

Lines changed: 295 additions & 76 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,64 @@ name: CI
33
on: [push]
44

55
jobs:
6-
build:
6+
composer:
77
runs-on: ubuntu-latest
88

99
steps:
1010
- uses: actions/checkout@v2
11-
- uses: php-actions/composer@v4
12-
- name: Upload build for test runner
11+
12+
- name: Cache Composer dependencies
13+
uses: actions/cache@v2
14+
with:
15+
path: /tmp/composer-cache
16+
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
17+
18+
- uses: php-actions/composer@v5
19+
20+
- name: Archive build
21+
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
22+
23+
- name: Upload build archive for test runners
1324
uses: actions/upload-artifact@v2
1425
with:
1526
name: build-artifact
16-
path: ./
27+
path: /tmp/github-actions
1728

1829
phpunit:
1930
runs-on: ubuntu-latest
20-
needs: [build]
31+
needs: [composer]
2132

2233
steps:
2334
- uses: actions/download-artifact@v2
2435
with:
2536
name: build-artifact
26-
path: ./
37+
path: /tmp/github-actions
38+
39+
- name: Extract build archive
40+
run: tar -xvf /tmp/github-actions/build.tar ./
2741

2842
- name: PHP Unit tests
29-
uses: php-actions/phpunit@v1
43+
uses: php-actions/phpunit@v2
3044
with:
31-
bootstrap: vendor/autoload.php
45+
php_version: 8.0
46+
php_extensions: xdebug
3247
configuration: test/phpunit/phpunit.xml
48+
bootstrap: vendor/autoload.php
3349

3450
phpstan:
3551
runs-on: ubuntu-latest
36-
needs: [build]
52+
needs: [composer]
3753

3854
steps:
3955
- uses: actions/download-artifact@v2
4056
with:
4157
name: build-artifact
42-
path: ./
58+
path: /tmp/github-actions
59+
60+
- name: Extract build archive
61+
run: tar -xvf /tmp/github-actions/build.tar ./
4362

4463
- name: PHP Static Analysis
45-
uses: php-actions/phpstan@v1
64+
uses: php-actions/phpstan@v2
4665
with:
4766
path: src/

.scrutinizer.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
build:
22
environment:
3-
php:
4-
version: 7.4.0
5-
tests:
6-
override:
7-
- php-scrutinizer-run
8-
- phpcs-run ./src
9-
-
10-
command: 'vendor/bin/phpunit test/phpunit --coverage-clover coverage --whitelist src'
11-
coverage:
12-
file: 'coverage'
13-
format: 'php-clover'
3+
php: 8.0.0
4+
5+
nodes:
6+
analysis:
7+
tests:
8+
override:
9+
- php-scrutinizer-run
10+
11+
tests-and-coverage:
12+
environment:
13+
php:
14+
ini:
15+
"xdebug.mode": coverage
16+
tests:
17+
override:
18+
- phpcs-run ./src
19+
- command: "vendor/bin/phpunit test/phpunit --coverage-clover test/phpunit/_coverage --whitelist src"
20+
coverage:
21+
file: "test/phpunit/_coverage"
22+
format: "php-clover"
1423

1524
checks:
1625
php:

0 commit comments

Comments
 (0)