Skip to content

Commit b2a3f4b

Browse files
committed
Update of workflow actions
1 parent 72dd85d commit b2a3f4b

File tree

3 files changed

+53
-57
lines changed

3 files changed

+53
-57
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ name: build
66

77
jobs:
88
tests:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
10+
1011
runs-on: ${{ matrix.os }}
12+
1113
env:
12-
extensions: curl, mbstring, dom
1314
key: cache-v1
1415

1516
strategy:
@@ -18,19 +19,18 @@ jobs:
1819
- ubuntu-latest
1920
- windows-latest
2021

21-
php-version:
22+
php:
2223
- "7.4"
2324
- "8.0"
2425

2526
steps:
2627
- name: Checkout
27-
uses: actions/checkout@v2.3.4
28+
uses: actions/checkout@v2
2829

2930
- name: Install PHP
3031
uses: shivammathur/setup-php@v2
3132
with:
32-
php-version: ${{ matrix.php-version }}
33-
extensions: ${{ env.extensions }}
33+
php-version: ${{ matrix.php }}
3434
ini-values: date.timezone='UTC'
3535
tools: composer:v2
3636
coverage: pcov
@@ -44,38 +44,18 @@ jobs:
4444
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4545

4646
- name: Cache dependencies installed with composer
47-
uses: actions/cache@v1
47+
uses: actions/cache@v2
4848
with:
4949
path: ${{ env.COMPOSER_CACHE_DIR }}
50-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
50+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
5151
restore-keys: |
52-
php${{ matrix.php-version }}-composer-
52+
php${{ matrix.php }}-composer-
5353
5454
- name: Update composer
5555
run: composer self-update
5656

57-
- name: Install dependencies with composer php 7.4
58-
if: matrix.php-version == '7.4'
59-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
60-
61-
- name: Install dependencies with composer php 8.0
62-
if: matrix.php-version == '8.0'
63-
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader
64-
65-
- name: PHPUnit run with coverage on Linux PHP 7.4
66-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
67-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
68-
69-
- name: PHPUnit run without coverage on Linux PHP 8.0
70-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.0'
71-
run: vendor/bin/phpunit
72-
73-
- name: PHPUnit run without coverage on Windows
74-
if: matrix.os == 'windows-latest'
75-
run: vendor/bin/phpunit
57+
- name: Install dependencies with composer
58+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7659

77-
- name: Code coverage scrutinizer on Linux PHP 7.4
78-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
79-
run: |
80-
wget https://scrutinizer-ci.com/ocular.phar
81-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
60+
- name: Run tests with phpunit
61+
run: vendor/bin/phpunit --colors=always

.github/workflows/static.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: static
66

77
jobs:
88
static:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1010

1111
runs-on: ${{ matrix.os }}
1212

@@ -15,17 +15,18 @@ jobs:
1515
os:
1616
- ubuntu-latest
1717

18-
php-version:
18+
php:
1919
- "7.4"
20+
- "8.0"
2021

2122
steps:
2223
- name: Checkout
23-
uses: actions/checkout@v2.3.4
24+
uses: actions/checkout@v2
2425

2526
- name: Install PHP
2627
uses: shivammathur/setup-php@v2
2728
with:
28-
php-version: ${{ matrix.php-version }}
29+
php-version: ${{ matrix.php }}
2930
ini-values: memory_limit=-1
3031
tools: composer:v2
3132

@@ -36,15 +37,15 @@ jobs:
3637
uses: actions/cache@v2
3738
with:
3839
path: ${{ env.COMPOSER_CACHE_DIR }}
39-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
40+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4041
restore-keys: |
41-
php${{ matrix.php-version }}-composer-
42+
php${{ matrix.php }}-composer-
4243
4344
- name: Update composer
4445
run: composer self-update
4546

4647
- name: Install dependencies with composer
47-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
48+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4849

4950
- name: PHPCS check
5051
run: vendor/bin/phpcs

.scrutinizer.yml

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
build:
2-
environment:
3-
php: "7.4"
4-
nodes:
5-
analysis:
6-
tests:
7-
override:
8-
- php-scrutinizer-run
9-
filter:
10-
paths:
11-
- "src/*"
121
checks:
13-
php: true
14-
tools:
15-
php_code_coverage:
16-
enabled: true
17-
external_code_coverage:
18-
timeout: 600
2+
php: true
3+
4+
filter:
5+
paths:
6+
- "src/*"
7+
8+
build:
9+
nodes:
10+
analysis:
11+
environment:
12+
php: 7.4.12
13+
14+
tests:
15+
override:
16+
- php-scrutinizer-run
17+
18+
tests-and-coverage:
19+
environment:
20+
php: 7.4.12
21+
22+
dependencies:
23+
override:
24+
- composer self-update
25+
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
26+
27+
tests:
28+
override:
29+
- command: "./vendor/bin/phpunit --coverage-clover ./coverage.xml"
30+
on_node: 1
31+
coverage:
32+
file: coverage.xml
33+
format: php-clover

0 commit comments

Comments
 (0)