Skip to content

Commit a8815b2

Browse files
authored
add ci workflow to run tests on supported php versions (#71)
1 parent 80850e8 commit a8815b2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
19+
name: Run tests on PHP ${{ matrix.php-versions }}
20+
21+
steps:
22+
- name: Install PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
extensions: json
27+
28+
- uses: actions/checkout@v4
29+
30+
- name: Validate composer.json and composer.lock
31+
run: composer validate --strict
32+
33+
- name: Cache Composer packages
34+
id: composer-cache
35+
uses: actions/cache@v3
36+
with:
37+
path: vendor
38+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-php-
41+
42+
- name: Install dependencies
43+
run: composer install --prefer-dist --no-progress
44+
45+
- name: Run test suite
46+
run: composer run-script test

0 commit comments

Comments
 (0)