-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (51 loc) · 1.5 KB
/
test.yml
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
name: Unit tests
on:
# Run on PRs and pushes.
push:
pull_request:
paths-ignore:
- '**.md'
- '**.yml'
- '**.json'
- '**.xml'
- '**.neon'
- '**.lock'
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: PHP setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Run unit tests
run: composer test:unit
- name: Run coverage generation
run: composer test:coverage -q # We don't need an output for coverage, codecov will do that.
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tests/coverage/clover.xml
flags: unittests
name: libs-codecov
fail_ci_if_error: true