-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (91 loc) · 2.88 KB
/
ci.yaml
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
name: CI
on:
pull_request: ~
push:
branches:
- 1.x
schedule:
- cron: "42 3 * * 1"
jobs:
tests:
name: ${{ matrix.description }} - PHP ${{ matrix.php }}
runs-on: ubuntu-latest
services:
mongo:
image: mongo:4.4
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootPass
strategy:
matrix:
composer: ['composer:v2']
dependencies: ['highest']
description: ['Tests']
php: ['8.3']
mongodb: ['1.17.2']
include:
- description: Tests - Symfony 6.4
php: '8.2'
symfony-version: '6.4.*'
mongodb: '1.15.3' # 1.15 introduced PHP 8.2 support
- description: Tests - Symfony 5.4
php: '8.1'
symfony-version: '5.4.*'
mongodb: '1.12.1' # 1.12 introduced PHP 8.1 support
- description: Tests - Symfony 5.4
php: '8.0'
symfony-version: '5.4.*'
- description: Tests - Symfony 4.4
php: '7.4'
mongodb: '1.9.2' # 1.9.0 introduced PHP 8.0 support
symfony-version: '4.4.*'
- description: Prefer lowest
composer: 'composer:v1'
dependencies: 'lowest'
php: '7.4'
symfony-version: '^4.4.1'
mongodb: '1.2.0'
deprecations: disabled
- description: Infection
mongodb: '1.9.2'
php: '7.4'
symfony-version: '4.4.*'
env:
MONGO_HOST: localhost
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mongodb
coverage: xdebug2
tools: flex,${{ matrix.composer }}
- name: Allow unstable dependencies
run: composer config minimum-stability dev
if: matrix.symfony-version == 'dev-master'
- name: Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Await a bit for Mongo to spin up...
run: timeout 60 nc -z localhost 27017
- name: Run tests
if: matrix.description != 'Infection'
run: vendor/bin/phpunit --coverage-clover=build/coverage-report.xml
env:
SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.deprecations }}
- name: Run mutation testing
if: matrix.description == 'Infection'
run: vendor/bin/infection --show-mutations
- name: Upload code coverage
if: matrix.description != 'Infection'
uses: codecov/codecov-action@v5
with:
files: build/coverage-report.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}