-
Notifications
You must be signed in to change notification settings - Fork 2
161 lines (158 loc) · 5.53 KB
/
Copy pathCI.yml
File metadata and controls
161 lines (158 loc) · 5.53 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI
permissions: {}
on:
push:
branches:
- master
pull_request:
jobs:
tests:
name: Tests on PHP ${{ matrix.php }} ${{ matrix.dependencies }}
runs-on: ubuntu-24.04
permissions:
contents: read
services:
valkey:
image: valkey/valkey
ports:
- 6379/tcp
strategy:
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
dependencies: ['--ignore-platform-req=php', '--prefer-lowest --prefer-stable --ignore-platform-req=php']
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: ${{ matrix.php }}
extensions: mbstring, redis, apcu
ini-values: apc.enable_cli=1, zend.assertions=1
coverage: pcov
- name: Remove Composer lockfile
run: rm composer.lock
- name: Install dependencies
run: composer update --no-interaction --prefer-dist ${{ matrix.dependencies }}
- name: Configure PHPUnit matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run tests
run: ./vendor/bin/phpunit --colors --coverage-clover=coverage.xml
env:
REDIS_PORT: ${{ job.services.valkey.ports['6379'] }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: ./coverage.xml
mutation_testing:
name: Mutation testing
runs-on: ubuntu-24.04
services:
valkey:
image: valkey/valkey
ports:
- 6379/tcp
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: '8.2'
extensions: mbstring, redis, apcu
ini-values: apc.enable_cli=1, zend.assertions=1
coverage: pcov
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run Infection
run: ./vendor/bin/infection --min-msi=90 --min-covered-msi=90 --static-analysis-tool=phpstan
env:
REDIS_PORT: ${{ job.services.valkey.ports['6379'] }}
- name: Archive report
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Infection report
path: infection.log
integration:
name: Integration tests on PHP ${{ matrix.php }}
runs-on: ubuntu-24.04
strategy:
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
- name: Start stack
run: |
docker compose up -d
sleep 10
docker ps -a
env:
PHP_VERSION: ${{ matrix.php }}
- name: Tests with Redis
run: docker compose exec -T phpunit env ADAPTER=redis vendor/bin/phpunit --testsuite=functionnal
env:
PHP_VERSION: ${{ matrix.php }}
- name: Tests with APCU
run: docker compose exec -T phpunit env ADAPTER=apcu vendor/bin/phpunit --testsuite=functionnal
env:
PHP_VERSION: ${{ matrix.php }}
code_quality:
name: Code quality
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: '8.2'
extensions: mbstring, redis, apcu
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: PHPCS
run: ./vendor/bin/phpcs
- name: Psalm
run: ./vendor/bin/psalm --shepherd
- name: PHPStan
run: ./vendor/bin/phpstan analyse
backward_compatible_changes:
name: Backward Compatible Changes
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# Disable (temporarily) CI check with Roave BC check
# See https://github.com/Nyholm/roave-bc-check-docker/issues/32
#- name: Roave BC Check
# uses: docker://nyholm/roave-bc-check-ga
# with:
# args: roave-backwards-compatibility-check:assert-backwards-compatible --from=v1.0.0
nix-shell:
name: Working Nix Shell
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install nix
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install dependencies
run: nix-shell --pure --run 'composer install --no-interaction --prefer-dist'
- name: Basic tests
run: nix-shell --pure --run './vendor/bin/psalm'