-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (65 loc) · 2.05 KB
/
test-runner.yml
File metadata and controls
81 lines (65 loc) · 2.05 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
79
80
81
name: Tests
on:
# Run testing on all push and pull requests for the master branch that have committed changes in PHP files
push:
branches: [ "master" ]
paths:
- '**.php'
pull_request:
branches: [ "master" ]
paths:
- '**.php'
# Make it possible to run the workflow manually
workflow_dispatch:
permissions:
contents: read
env:
LANG: "sl_SI.utf8"
jobs:
test:
runs-on: ${{ matrix.os }}
# Define the matrix of different PHP and dependency versions
strategy:
# Fail the whole workflow if one of the jobs fails
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 ]
name: ${{ matrix.os }} / PHP ${{ matrix.php }}
steps:
- name: Set up system locales
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y locales
sudo locale-gen ${{ env.LANG }}
- name: Checkout code
uses: actions/checkout@v6.0.2
with:
ref: ${{ github.head_ref }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5.0.5
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
extensions: gettext
- name: Install dependencies
run: composer update --prefer-dist --no-progress --prefer-stable
- name: Run test suite
run: ./tests.sh --coverage-clover ./coverage.xml
- name: Upload coverage reports to Codecov
# Make sure the Codecov action is only executed once
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
uses: codecov/codecov-action@v6.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
verbose: true