Skip to content

Commit 707e336

Browse files
Merge pull request #629 from MauricioFauth/gh-actions-update
Update GitHub actions
2 parents 1b70d03 + fd7cf1a commit 707e336

File tree

4 files changed

+166
-196
lines changed

4 files changed

+166
-196
lines changed

.github/workflows/lint-and-analyse-php.yml

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,52 @@ name: Lint and analyse php files
33
on:
44
push:
55
pull_request:
6-
types: [opened, synchronize, reopened]
6+
types: [ opened, synchronize, reopened ]
77

88
jobs:
9-
lint-php:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: Use php 7.2
14-
uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: 7.2
17-
tools: composer:v2
18-
- name: Validate composer.json and composer.lock
19-
run: composer validate
20-
- name: Cache module
21-
uses: actions/cache@v3
22-
with:
23-
path: ~/.composer/cache/
24-
key: composer-cache
25-
- name: Install dependencies
26-
run: composer install
27-
- name: Lint files
28-
run: composer run phpcs
29-
30-
analyse-php:
31-
runs-on: ubuntu-latest
32-
strategy:
33-
matrix:
34-
php-version: ["7.4"]
35-
steps:
36-
- uses: actions/checkout@v3
37-
- name: Use PHP ${{ matrix.php-version }}
38-
uses: shivammathur/setup-php@v2
39-
with:
40-
php-version: ${{ matrix.php-version }}
41-
tools: composer:v2
42-
43-
- name: Get Composer cache directory
44-
id: composer-cache
45-
run: |
46-
echo "::set-output name=dir::$(composer config cache-files-dir)"
47-
48-
- name: Cache dependencies
49-
uses: actions/cache@v3
50-
with:
51-
path: ${{ steps.composer-cache.outputs.dir }}
52-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
53-
restore-keys: |
54-
composer-${{ runner.os }}-${{ matrix.php-version }}-
55-
56-
- name: Install dependencies
57-
run: composer install
58-
- name: Analyse files with PHPStan
59-
run: composer run phpstan
60-
- name: Analyse files with Psalm
61-
# Allow the previous check to fail but not abort
62-
if: always()
63-
run: composer run psalm -- --shepherd
9+
lint-php:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php-version: [ '7.2' ]
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up PHP ${{ matrix.php-version }}
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-version }}
22+
23+
- name: Install Composer dependencies
24+
uses: ramsey/composer-install@v3
25+
26+
- name: Check coding-standard
27+
run: composer run phpcs
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate --strict
31+
32+
analyse-php:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
php-version: [ '7.4' ]
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Set up PHP ${{ matrix.php-version }}
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: ${{ matrix.php-version }}
45+
46+
- name: Install Composer dependencies
47+
uses: ramsey/composer-install@v3
48+
49+
- name: Analyse files with PHPStan
50+
run: composer run phpstan
51+
52+
- name: Analyse files with Psalm
53+
if: always()
54+
run: composer run psalm -- --shepherd

.github/workflows/lint-docs.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
name: lint php documentation
1+
name: Lint PHP documentation
22

33
on:
44
push:
55
pull_request:
6-
types: [opened, synchronize, reopened]
6+
types: [ opened, synchronize, reopened ]
77

88
jobs:
9-
lint-docs:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: lint php documentation
14-
uses: sudo-bot/action-doctum@v5
15-
with:
16-
config-file: tools/doctum-config.php
17-
method: "parse"
18-
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"
9+
lint-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: lint php documentation
16+
uses: sudo-bot/action-doctum@v5
17+
with:
18+
config-file: tools/doctum-config.php
19+
method: "parse"
20+
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"

.github/workflows/mutation-tests.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,37 @@ name: Mutation tests
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [ master ]
66
pull_request:
7-
branches: [master]
7+
branches: [ master ]
88

99
jobs:
1010
tests:
1111
name: Mutation tests with PHP ${{ matrix.php-version }}
12-
1312
runs-on: ${{ matrix.operating-system }}
14-
1513
strategy:
1614
matrix:
17-
php-version: ["8.1"]
18-
operating-system: [ubuntu-latest]
19-
15+
php-version: [ '8.1' ]
16+
operating-system: [ ubuntu-latest ]
2017
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v3
18+
- name: Checkout code
19+
uses: actions/checkout@v4
2320

2421
- name: Fetch github.base_ref (for diffing)
2522
if: ${{ github.base_ref != '' }}
2623
run: |
2724
git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
2825
29-
- name: Install PHP ${{ matrix.php-version }}
26+
- name: Set up PHP ${{ matrix.php-version }}
3027
uses: shivammathur/setup-php@v2
3128
with:
3229
php-version: ${{ matrix.php-version }}
3330
coverage: pcov
3431
ini-values: memory_limit=-1
35-
tools: composer:v2, infection
36-
37-
- name: Get Composer cache directory
38-
id: composer-cache
39-
run: |
40-
echo "::set-output name=dir::$(composer config cache-files-dir)"
41-
42-
- name: Cache dependencies
43-
uses: actions/cache@v3
44-
with:
45-
path: ${{ steps.composer-cache.outputs.dir }}
46-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
47-
restore-keys: |
48-
composer-${{ runner.os }}-${{ matrix.php-version }}-
32+
tools: infection
4933

50-
- name: Install dependencies
51-
run: |
52-
composer update --no-interaction --no-progress
34+
- name: Install Composer dependencies
35+
uses: ramsey/composer-install@v3
5336

5437
- name: Collect coverage report
5538
run: composer run phpunit -- --stop-on-failure

0 commit comments

Comments
 (0)