-
-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (106 loc) · 3.5 KB
/
Copy pathci-core.yml
File metadata and controls
125 lines (106 loc) · 3.5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Core CI
on:
pull_request:
push:
branches: [main]
# Cancel superseded runs on the same branch (e.g. when a PR gets a new push)
# so we don't pay for stale-commit mutation runs. The concurrency group is
# keyed on the workflow name + ref, so this is per-workflow — the LSP CI
# can run concurrently with this one without queueing.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
phpunit:
# 8.4 is the supported/default runtime and runs the full suite minus the
# `php85` group; a dedicated 8.5 container runs only that group, which
# covers syntax (e.g. the pipe operator `|>`) that the host-version
# parser can only tokenize on PHP 8.5.
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.4'
target: test/unit
- php: '8.5'
target: test/unit/php85
steps:
- uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, json, mbstring, tokenizer
coverage: none
tools: composer:v2
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run PHPUnit
run: make ${{ matrix.target }}
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, json, mbstring, tokenizer
coverage: none
tools: composer:v2
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run PHPStan
run: make lint/phpstan
check:
# End-to-end self-test of the `xphp check` gate: runs the real bin/xphp
# binary against the check fixtures and asserts the 0/1/2 exit contract.
# The in-process CheckCommandTest can't observe the shipped binary's
# process exit code or its rendered stdout, so this covers that gap.
name: xphp check (self-test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, json, mbstring, tokenizer
coverage: none
tools: composer:v2
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run xphp check self-test
run: make test/check
infection:
name: Mutation testing
runs-on: ubuntu-latest
needs: phpunit
steps:
- uses: actions/checkout@v4
- name: Setup PHP 8.4 (with Xdebug for coverage)
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, json, mbstring, tokenizer
coverage: xdebug
tools: composer:v2
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run Infection
# --min-covered-msi=95 fails CI if the mutation score drops below
# the gate. Threads=max parallelises mutant runs.
run: make test/mutation
- name: Upload Infection report
if: always()
uses: actions/upload-artifact@v4
with:
name: infection-report
path: |
var/infection.log
var/infection.html
if-no-files-found: ignore
retention-days: 14