-
-
Notifications
You must be signed in to change notification settings - Fork 83
77 lines (62 loc) · 2.11 KB
/
ci.yml
File metadata and controls
77 lines (62 loc) · 2.11 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
name: CI
on: [push, pull_request]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: PHP ${{ matrix.php }}${{ matrix.coverage && ' / Coverage' || '' }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- php: "8.4"
# Coverage run
- php: "8.4"
coverage: true
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, mbstring, mysqli
tools: composer
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
- name: Show versions
run: |
php -v
composer --version
- name: Get Composer cache dir
id: composer-cache
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.json.dist') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php }}-
- name: Prepare composer.json
run: cp composer.json.dist composer.json
- name: Install dependencies
run: composer update --prefer-stable --no-interaction --prefer-dist --no-progress
- name: Check platform requirements
run: composer check-platform-reqs
- name: Ensure build directory exists
run: mkdir -p build/logs
- name: Run tests
if: ${{ !matrix.coverage }}
run: xoops_lib/vendor/bin/phpunit --colors=always
- name: Run tests with coverage
if: ${{ matrix.coverage }}
run: xoops_lib/vendor/bin/phpunit --colors=always --coverage-clover coverage.clover
- name: Upload coverage to Codecov
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v5
with:
files: coverage.clover
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false