Skip to content

Commit 927f847

Browse files
author
Greg Bowler
authored
Upgrade CI (#87)
* Upgrade CI * Fix static analysis on stubs
1 parent c49b24f commit 927f847

File tree

17 files changed

+962
-420
lines changed

17 files changed

+962
-420
lines changed

.circleci/config.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These are supported funding model platforms
2+
github: [phpgt]

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
composer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
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
24+
uses: actions/upload-artifact@v2
25+
with:
26+
name: build-artifact
27+
path: /tmp/github-actions
28+
29+
phpunit:
30+
runs-on: ubuntu-latest
31+
needs: [composer]
32+
33+
steps:
34+
- uses: actions/download-artifact@v2
35+
with:
36+
name: build-artifact
37+
path: /tmp/github-actions
38+
39+
- name: Extract build archive
40+
run: tar -xvf /tmp/github-actions/build.tar ./
41+
42+
- name: PHP Unit tests
43+
uses: php-actions/phpunit@v2
44+
with:
45+
php_version: 8.0
46+
php_extensions: xdebug
47+
configuration: test/phpunit/phpunit.xml
48+
bootstrap: vendor/autoload.php
49+
50+
phpstan:
51+
runs-on: ubuntu-latest
52+
needs: [composer]
53+
54+
steps:
55+
- uses: actions/download-artifact@v2
56+
with:
57+
name: build-artifact
58+
path: /tmp/github-actions
59+
60+
- name: Extract build archive
61+
run: tar -xvf /tmp/github-actions/build.tar ./
62+
63+
- name: PHP Static Analysis
64+
uses: php-actions/phpstan@v2
65+
with:
66+
path: src/

.scrutinizer.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
build:
22
environment:
3-
php:
4-
version: 7.2.0
5-
tests:
6-
override:
7-
-
8-
command: 'vendor/bin/phpunit test/unit --coverage-clover coverage --whitelist src'
9-
coverage:
10-
file: 'coverage'
11-
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"
1223

1324
checks:
1425
php:
@@ -17,5 +28,5 @@ checks:
1728

1829
filter:
1930
excluded_paths:
20-
- test/*
21-
- vendor/*
31+
- test/*
32+
- vendor/*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See also, the [JavaScript implementation][fetch-js] that ships as standard in al
88

99
***
1010

11-
<a href="https://circleci.com/gh/PhpGt/Fetch" target="_blank">
11+
<a href="https://github.com/PhpGt/Fetch/actions" target="_blank">
1212
<img src="https://badge.status.php.gt/fetch-build.svg" alt="Build status" />
1313
</a>
1414
<a href="https://scrutinizer-ci.com/g/PhpGt/Fetch" target="_blank">

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
},
2323

2424
"require-dev": {
25-
"phpunit/phpunit": "8.*"
25+
"phpunit/phpunit": "9.*",
26+
"phpstan/phpstan": ">=0.12.42"
2627
},
2728

2829
"autoload": {
@@ -33,7 +34,7 @@
3334

3435
"autoload-dev": {
3536
"psr-4": {
36-
"Gt\\Fetch\\Test\\": "./test/unit"
37+
"Gt\\Fetch\\Test\\": "./test/phpunit"
3738
}
3839
},
3940

0 commit comments

Comments
 (0)