Skip to content

Commit b57c1e1

Browse files
committed
Improve CI
1 parent f03232d commit b57c1e1

5 files changed

Lines changed: 131 additions & 87 deletions

File tree

.github/actions/setup-php/action.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/codestyle.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,44 @@ env:
88
PHP_CS_FIXER_IGNORE_ENV: 1
99

1010
jobs:
11-
psalm:
11+
php-cs-fixer:
1212
name: Code Style
13-
runs-on: ubuntu-latest
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: [ '8.4' ]
18+
os: [ ubuntu-latest ]
19+
stability: [ 'stable' ]
1420
steps:
21+
- name: Set Git To Use LF
22+
run: |
23+
git config --global core.autocrlf false
24+
git config --global core.eol lf
1525
- name: Checkout
16-
uses: actions/checkout@v5
17-
18-
- name: Setup PHP ${{ matrix.php }} Environment
19-
uses: ./.github/actions/setup-php
26+
uses: actions/checkout@v7
27+
- name: Setup PHP ${{ matrix.php }}
28+
uses: shivammathur/setup-php@v2
2029
with:
21-
os: ubuntu-latest
22-
php: 8.4
23-
30+
php-version: ${{ matrix.php }}
31+
ini-values: "memory_limit=-1"
32+
- name: Validate Composer
33+
run: composer validate
34+
- name: Get Composer Cache Directory
35+
id: composer-cache
36+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
37+
- name: Restore Composer Cache
38+
uses: actions/cache@v5
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
42+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
43+
- name: Install Dependencies
44+
uses: nick-invision/retry@v4
45+
with:
46+
timeout_minutes: 5
47+
max_attempts: 3
48+
command: composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
49+
# Action
2450
- name: Check Code Style
2551
run: composer phpcs:check

.github/workflows/security.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,42 @@ on:
77
jobs:
88
security:
99
name: Security
10-
runs-on: ubuntu-latest
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.4' ]
15+
os: [ ubuntu-latest ]
16+
stability: [ 'stable' ]
1117
steps:
18+
- name: Set Git To Use LF
19+
run: |
20+
git config --global core.autocrlf false
21+
git config --global core.eol lf
1222
- name: Checkout
13-
uses: actions/checkout@v5
14-
15-
- name: Setup PHP ${{ matrix.php }} Environment
16-
uses: ./.github/actions/setup-php
23+
uses: actions/checkout@v7
24+
- name: Setup PHP ${{ matrix.php }}
25+
uses: shivammathur/setup-php@v2
1726
with:
18-
os: ubuntu-latest
19-
php: 8.4
20-
27+
php-version: ${{ matrix.php }}
28+
ini-values: "memory_limit=-1"
29+
- name: Validate Composer
30+
run: composer validate
31+
- name: Get Composer Cache Directory
32+
id: composer-cache
33+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34+
- name: Restore Composer Cache
35+
uses: actions/cache@v5
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
40+
- name: Install Dependencies
41+
uses: nick-invision/retry@v4
42+
with:
43+
timeout_minutes: 5
44+
max_attempts: 3
45+
command: composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
46+
# Action
2147
- name: Composer Audit
2248
run: composer audit

.github/workflows/static-analysis.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,43 @@ on:
66

77
jobs:
88
phpstan:
9-
name: Linter
10-
runs-on: ubuntu-latest
9+
name: PHPStan
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.4' ]
15+
os: [ ubuntu-latest ]
16+
stability: [ 'stable' ]
1117
steps:
18+
- name: Set Git To Use LF
19+
run: |
20+
git config --global core.autocrlf false
21+
git config --global core.eol lf
1222
- name: Checkout
13-
uses: actions/checkout@v5
14-
15-
- name: Setup PHP ${{ matrix.php }} Environment
16-
uses: ./.github/actions/setup-php
23+
uses: actions/checkout@v7
24+
- name: Setup PHP ${{ matrix.php }}
25+
uses: shivammathur/setup-php@v2
1726
with:
18-
os: ubuntu-latest
19-
php: 8.4
20-
27+
php-version: ${{ matrix.php }}
28+
ini-values: "memory_limit=-1"
29+
- name: Validate Composer
30+
run: composer validate
31+
- name: Get Composer Cache Directory
32+
id: composer-cache
33+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34+
- name: Restore Composer Cache
35+
uses: actions/cache@v5
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
40+
- name: Install Dependencies
41+
uses: nick-invision/retry@v4
42+
with:
43+
timeout_minutes: 5
44+
max_attempts: 3
45+
command: composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
46+
# Action
2147
- name: Static Analysis
2248
run: composer linter:check -- --error-format=github --ansi

.github/workflows/tests.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,34 @@ jobs:
1515
os: [ ubuntu-latest, macos-latest, windows-latest ]
1616
stability: [ lowest, stable ]
1717
steps:
18+
- name: Set Git To Use LF
19+
run: |
20+
git config --global core.autocrlf false
21+
git config --global core.eol lf
1822
- name: Checkout
19-
uses: actions/checkout@v5
20-
21-
- name: [${{ matrix.stability }}] Setup PHP ${{ matrix.php }} Environment
22-
uses: ./.github/actions/setup-php
23+
uses: actions/checkout@v7
24+
- name: Setup PHP ${{ matrix.php }}
25+
uses: shivammathur/setup-php@v2
2326
with:
24-
os: ${{ matrix.os }}
25-
php: ${{ matrix.php }}
26-
stability: ${{ matrix.stability }}
27-
27+
php-version: ${{ matrix.php }}
28+
ini-values: "memory_limit=-1"
29+
- name: Validate Composer
30+
run: composer validate
31+
- name: Get Composer Cache Directory
32+
id: composer-cache
33+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34+
- name: Restore Composer Cache
35+
uses: actions/cache@v5
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
40+
- name: Install Dependencies
41+
uses: nick-invision/retry@v4
42+
with:
43+
timeout_minutes: 5
44+
max_attempts: 3
45+
command: composer update --prefer-${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
46+
# Action
2847
- name: Execute Tests
2948
run: composer test

0 commit comments

Comments
 (0)