Skip to content

Commit 2584fad

Browse files
committed
add github actions test workflow
1 parent d89e786 commit 2584fad

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/test.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php-version: [ '8.3' ]
17+
18+
name: Run tests on PHP v${{ matrix.php-version }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-version }}
28+
29+
- name: Set composer cache directory
30+
id: composer-cache
31+
run: echo "COMPOSER_CACHE_DIRECTORY=$(composer config cache-files-dir)" >> $GITHUB_ENV
32+
33+
- name: Restore composer from cache
34+
uses: actions/cache@v4
35+
with:
36+
path: ${{ env.COMPOSER_CACHE_DIRECTORY }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: ${{ runner.os }}-composer-
39+
40+
- name: Install composer dependencies
41+
run: composer install --no-interaction --prefer-dist --no-progress
42+
43+
- name: Run phpunit tests
44+
run: composer test

0 commit comments

Comments
 (0)