Skip to content

Commit a841f8a

Browse files
Use yiisoft/actions. (#540)
1 parent c31a3aa commit a841f8a

File tree

2 files changed

+26
-43
lines changed

2 files changed

+26
-43
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ trim_trailing_whitespace = true
1212

1313
[*.md]
1414
trim_trailing_whitespace = false
15+
16+
[*.yml]
17+
indent_size = 2

.github/workflows/build.yml

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,27 @@
1-
name: build
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
29

3-
on: [push, pull_request]
10+
push:
11+
paths-ignore:
12+
- 'docs/**'
13+
- 'README.md'
14+
- 'CHANGELOG.md'
15+
- '.gitignore'
16+
- '.gitattributes'
417

5-
env:
6-
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
18+
name: build
719

820
jobs:
9-
phpunit:
10-
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
17-
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v2
21-
- name: Install PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php }}
25-
- name: Get composer cache directory
26-
id: composer-cache
27-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
28-
- name: Cache composer dependencies
29-
uses: actions/cache@v1
30-
with:
31-
path: ${{ steps.composer-cache.outputs.dir }}
32-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
33-
restore-keys: ${{ runner.os }}-composer-
34-
- name: Install dependencies
35-
run: composer update $DEFAULT_COMPOSER_FLAGS
36-
- name: Run unit tests with coverage
37-
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --colors=always
38-
if: matrix.php == '7.1'
39-
- name: Run unit tests without coverage
40-
run: vendor/bin/phpunit --verbose --colors=always
41-
if: matrix.php != '7.1'
42-
- name: Upload code coverage
43-
run: |
44-
wget https://scrutinizer-ci.com/ocular.phar
45-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
46-
if: matrix.php == '7.1'
47-
continue-on-error: true # if is fork
21+
phpunit:
22+
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
23+
with:
24+
os: >-
25+
['ubuntu-latest']
26+
php: >-
27+
['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

0 commit comments

Comments
 (0)