-
-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (63 loc) · 2.02 KB
/
Copy pathci.yaml
File metadata and controls
78 lines (63 loc) · 2.02 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# yamllint disable rule:line-length
# yamllint disable rule:braces
name: Tests
on:
pull_request:
push:
branches:
- main
- master
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
php-version: [ '8.3', '8.4', '8.5' ]
name: Unit tests on PHP ${{ matrix.php-version }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- name: Run tests
run: make test-unit
# This is a meta job to avoid to have to constantly change the protection rules
# whenever we touch the matrix.
tests-status:
name: Tests Status
runs-on: ubuntu-latest
timeout-minutes: 30
needs: tests
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1