-
Notifications
You must be signed in to change notification settings - Fork 520
37 lines (34 loc) · 1.27 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: phpunit
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1]
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- uses: actions/checkout@v3
- name: setup php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
coverage: xdebug
- name: setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: determine composer cache directory
id: composer-cache
run: "echo \"directory=$(composer config cache-dir)\" >> $GITHUB_OUTPUT"
- name: cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: php-${{ matrix.php-version }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-${{ matrix.stability }}-composer
- run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- run: composer run test