Repository navigation
77 lines (71 loc) · 3.19 KB
/
Copy pathtest.yml
File metadata and controls
77 lines (71 loc) · 3.19 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: Test
on:
push:
branches:
- main
pull_request:
# Weekly build: the dependencies are not locked, a new version of a dependency may break the build
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: read
# A new push cancels the build of the previous one, on a pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }}${{ matrix.symfony-require && format(' + Symfony {0}', matrix.symfony-require) || '' }}
runs-on: ubuntu-latest
timeout-minutes: 20
env:
SYMFONY_REQUIRE: ${{matrix.symfony-require}}
strategy:
fail-fast: false
matrix:
include:
# Lowest versions allowed by composer.json, on the lowest supported PHP version
- { php-version: '8.2', dependencies: lowest, symfony-require: '' }
# Highest versions, for each supported Symfony version (8.x requires PHP 8.4)
- { php-version: '8.2', dependencies: highest, symfony-require: 6.4.* }
- { php-version: '8.2', dependencies: highest, symfony-require: 7.4.* }
- { php-version: '8.3', dependencies: highest, symfony-require: 6.4.* }
- { php-version: '8.3', dependencies: highest, symfony-require: 7.4.* }
- { php-version: '8.4', dependencies: highest, symfony-require: 6.4.* }
- { php-version: '8.4', dependencies: highest, symfony-require: 7.4.* }
- { php-version: '8.4', dependencies: highest, symfony-require: 8.* }
- { php-version: '8.5', dependencies: highest, symfony-require: 6.4.* }
- { php-version: '8.5', dependencies: highest, symfony-require: 7.4.* }
- { php-version: '8.5', dependencies: highest, symfony-require: 8.* }
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install PHP with extensions
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2, flex
- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Composer dependencies (${{ matrix.dependencies }})
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Run Tests with coverage
run: vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml
#- name: Send coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# files: build/logs/clover.xml
# Single check to require in the branch protection of main: its name does not depend on the matrix
tests-passed:
name: Tests passed
if: always()
needs: [test]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check the result of the jobs
run: test "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}" = false