Skip to content

Commit e25a0b9

Browse files
Simplify github actions. (#139)
* Simplify github actions.
1 parent 325a52d commit e25a0b9

3 files changed

Lines changed: 22 additions & 119 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,11 @@ on:
2222
name: build
2323

2424
jobs:
25-
tests:
26-
name: PHP ${{ matrix.php }}-${{ matrix.os }}
27-
28-
env:
25+
phpunit:
26+
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
27+
with:
2928
extensions: pdo, pdo_sqlite
30-
key: cache-v1
31-
32-
runs-on: ${{ matrix.os }}
33-
34-
strategy:
35-
matrix:
36-
os:
37-
- ubuntu-latest
38-
- windows-latest
39-
40-
php:
41-
- 8.0
42-
- 8.1
43-
- 8.2
44-
45-
steps:
46-
- name: Checkout
47-
uses: actions/checkout@v3
48-
49-
- name: Install PHP with extensions
50-
uses: shivammathur/setup-php@v2
51-
with:
52-
php-version: ${{ matrix.php }}
53-
extensions: ${{ env.extensions }}
54-
ini-values: date.timezone='UTC'
55-
coverage: pcov
56-
tools: composer:v2
57-
58-
- name: Update composer
59-
run: composer self-update
60-
61-
- name: Install dependencies with composer
62-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
63-
64-
- name: Run tests with phpunit
65-
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always
66-
67-
- name: Upload coverage to Codecov
68-
uses: codecov/codecov-action@v3
69-
with:
70-
token: ${{ secrets.CODECOV_TOKEN }}
71-
files: ./coverage.xml
29+
os: >-
30+
['ubuntu-latest', 'windows-latest']
31+
php: >-
32+
['8.0', '8.1', '8.2']

.github/workflows/mutation.yml

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,11 @@ name: mutation test
2121

2222
jobs:
2323
mutation:
24-
name: PHP ${{ matrix.php }}-${{ matrix.os }}
25-
26-
env:
27-
extensions: pdo, pdo_sqlite
28-
29-
runs-on: ${{ matrix.os }}
30-
31-
strategy:
32-
matrix:
33-
os:
34-
- ubuntu-latest
35-
36-
php:
37-
- 8.0
38-
- 8.1
39-
40-
steps:
41-
- name: Checkout
42-
uses: actions/checkout@v3
43-
44-
- name: Install PHP with extensions
45-
uses: shivammathur/setup-php@v2
46-
with:
47-
php-version: ${{ matrix.php }}
48-
extensions: ${{ env.extensions }}
49-
ini-values: date.timezone='UTC'
50-
coverage: pcov
51-
tools: composer:v2
52-
53-
- name: Update composer
54-
run: composer self-update
55-
56-
- name: Install dependencies with composer
57-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
58-
59-
- name: Run infection
60-
run: |
61-
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
62-
env:
63-
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
24+
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master
25+
with:
26+
os: >-
27+
['ubuntu-latest']
28+
php: >-
29+
['8.1']
30+
secrets:
31+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/static.yml

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,10 @@ on:
2222
name: static analysis
2323

2424
jobs:
25-
mutation:
26-
name: PHP ${{ matrix.php }}-${{ matrix.os }}
27-
28-
runs-on: ${{ matrix.os }}
29-
30-
strategy:
31-
matrix:
32-
os:
33-
- ubuntu-latest
34-
35-
php:
36-
- 8.0
37-
- 8.1
38-
39-
steps:
40-
- name: Checkout
41-
uses: actions/checkout@v3
42-
43-
- name: Install PHP
44-
uses: shivammathur/setup-php@v2
45-
with:
46-
php-version: ${{ matrix.php }}
47-
tools: composer:v2, cs2pr
48-
coverage: none
49-
50-
- name: Update composer
51-
run: composer self-update
52-
53-
- name: Install dependencies with composer
54-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
55-
56-
- name: Static analysis
57-
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize
25+
psalm:
26+
uses: yiisoft/actions/.github/workflows/psalm.yml@master
27+
with:
28+
os: >-
29+
['ubuntu-latest']
30+
php: >-
31+
['8.0', '8.1', '8.2']

0 commit comments

Comments
 (0)