Skip to content

Commit 1ec3d5e

Browse files
Github: Add PHPUnit action that is triggered on push
1 parent 2ab73b1 commit 1ec3d5e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/phpunit.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PHPUnit Tests
2+
on: [push]
3+
jobs:
4+
run-phpstan:
5+
name: Run PHPUnit
6+
runs-on: ubuntu-latest
7+
steps:
8+
9+
- name: Setup PHP
10+
uses: shivammathur/setup-php@v2
11+
with:
12+
php-version: '8.4'
13+
extensions: dom, json, mbstring, psr, xdebug
14+
tools: composer:v2
15+
16+
- name: Check out code
17+
uses: actions/checkout@v2
18+
19+
- name: Get Composer cache directory
20+
id: composer-cache
21+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
22+
23+
- name: Connect downloaded dependencies with a cache in GitHub
24+
uses: actions/cache@v3
25+
with:
26+
path: ${{ steps.composer-cache.outputs.dir }}
27+
# Note: Normally, we'd use the composer.lock to generate a hash,
28+
# but the lock file is currently not versioned.
29+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
30+
restore-keys: ${{ runner.os }}-composer-
31+
32+
- name: Install dependencies
33+
run: composer install --prefer-dist
34+
35+
- name: Run PHPUnit
36+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)