Skip to content

Commit 2cfc3e7

Browse files
committed
:octocat: CI update
1 parent 7567e22 commit 2cfc3e7

File tree

1 file changed

+49
-28
lines changed

1 file changed

+49
-28
lines changed

.github/workflows/tests.yml

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2-
# https://github.com/localheinz/php-library-template/blob/master/.github/workflows/continuous-integration.yml
32
# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
43

54
on:
@@ -10,47 +9,69 @@ name: "Continuous Integration"
109

1110
jobs:
1211

13-
tests:
14-
name: "Unit Tests"
12+
static-code-analysis:
13+
name: "Static Code Analysis"
14+
1515
runs-on: ubuntu-latest
1616

17-
strategy:
18-
matrix:
19-
php-binary:
20-
- php7.2
21-
- php7.3
22-
- php7.4
23-
- php8.0
17+
env:
18+
PHAN_ALLOW_XDEBUG: 0
19+
PHAN_DISABLE_XDEBUG_WARN: 1
2420

2521
steps:
2622
- name: "Checkout"
27-
uses: actions/checkout@v1.1.0
23+
uses: actions/checkout@v2
2824

29-
- name: "Install dependencies with composer"
30-
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest
25+
- name: "Install PHP"
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: "7.2"
29+
coverage: none
30+
tools: pecl
31+
extensions: ast, gd, imagick, json, mbstring
3132

32-
- name: "Run unit tests with phpunit"
33-
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage
33+
- name: "Update dependencies with composer"
34+
run: composer update --no-interaction --no-ansi --no-progress --no-suggest
3435

36+
- name: "Run phan"
37+
run: php vendor/bin/phan
3538

36-
code-coverage:
37-
name: "Code Coverage"
38-
runs-on: ubuntu-latest
39+
tests:
40+
name: "Unit Tests"
41+
42+
runs-on: ${{ matrix.os }}
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
os:
48+
- ubuntu-latest
49+
- windows-latest
50+
php-version:
51+
- "7.2"
52+
- "7.3"
53+
- "7.4"
54+
- "8.0"
3955

4056
steps:
4157
- name: "Checkout"
42-
uses: actions/checkout@v1.1.0
58+
uses: actions/checkout@v2
4359

44-
- name: "Install locked dependencies with composer"
45-
run: php7.4 $(which composer) install --no-interaction --no-progress --no-suggest
60+
- name: "Install PHP with extensions"
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: ${{ matrix.php-version }}
64+
coverage: pcov
65+
tools: pecl
66+
extensions: gd, imagick, json, mbstring
4667

47-
- name: "Dump Xdebug filter with phpunit/phpunit"
48-
run: php7.4 vendor/bin/phpunit --configuration=phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php
68+
- name: "Install dependencies with composer"
69+
run: composer update --no-ansi --no-interaction --no-progress --no-suggest
4970

50-
- name: "Collect code coverage with Xdebug and phpunit/phpunit"
51-
run: php7.4 vendor/bin/phpunit --configuration=phpunit.xml --prepend=.build/phpunit/xdebug-filter.php
71+
- name: "Run tests with phpunit"
72+
run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml
5273

5374
- name: "Send code coverage report to Codecov.io"
54-
env:
55-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
56-
run: bash <(curl -s https://codecov.io/bash)
75+
uses: codecov/codecov-action@v1
76+
with:
77+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)