Skip to content

Commit 4f7480a

Browse files
committed
init
1 parent 418d663 commit 4f7480a

1 file changed

Lines changed: 45 additions & 32 deletions

File tree

.github/workflows/test.yml

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,57 @@ name: test
22

33
on:
44
push:
5-
branches: [ 3.x ]
5+
branches: [ "3.x" ]
66
pull_request:
7-
branches: [ 3.x ]
7+
branches: [ "3.x" ]
88

99
permissions:
1010
contents: read
1111

1212
jobs:
1313
build:
14-
15-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.operating-system }}
15+
strategy:
16+
max-parallel: 15
17+
matrix:
18+
operating-system: [ubuntu-latest]
19+
php-versions: ['8.2', '8.3']
20+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1621

1722
steps:
18-
- uses: actions/checkout@v3
19-
20-
- name: Validate composer.json and composer.lock
21-
run: composer validate --strict
22-
23-
- name: Cache Composer packages
24-
id: composer-cache
25-
uses: actions/cache@v3
26-
with:
27-
path: vendor
28-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-php-
31-
32-
- name: Install dependencies
33-
run: composer install --prefer-dist --no-progress
34-
35-
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36-
# Docs: https://getcomposer.org/doc/articles/scripts.md
37-
38-
39-
- name: Run test suite
40-
run: ./vendor/bin/phpunit --coverage-clover coverage.xml
41-
42-
- name: Upload coverage to Codecov
43-
uses: codecov/codecov-action@v1
44-
with:
45-
token: ${{ secrets.CODECOV_TOKEN }}
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Install PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php-versions }}
30+
31+
- name: Check PHP Version
32+
run: php -v
33+
34+
- name: Validate composer.json and composer.lock
35+
run: composer validate --strict
36+
37+
- name: Cache Composer packages
38+
id: composer-cache
39+
uses: actions/cache@v3
40+
with:
41+
path: vendor
42+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-php-
45+
46+
- name: Install dependencies
47+
run: composer install --prefer-dist --no-progress
48+
49+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
50+
# Docs: https://getcomposer.org/doc/articles/scripts.md
51+
52+
- name: Run test suite
53+
run: ./vendor/bin/phpunit --coverage-clover coverage.xml
54+
55+
- name: Upload coverage to Codecov
56+
uses: codecov/codecov-action@v1
57+
with:
58+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)