-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (97 loc) · 4.69 KB
/
ci.yml
File metadata and controls
118 lines (97 loc) · 4.69 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
on: [ push, pull_request ]
name: "CI"
jobs:
qa:
name: "QA (lint + static analysis)"
if: "!startsWith(github.event.head_commit.message, 'chore(release)')"
runs-on: "ubuntu-latest"
env:
PHP_CS_FIXER_IGNORE_ENV: true
steps:
- name: "Checkout"
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
- name: "Install PHP"
uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0
with:
coverage: "none"
php-version: "8.3"
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
- name: "Cache dependencies installed with composer"
uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-8.3-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: |
php-8.3-composer-locked-${{ github.ref_name }}
php-8.3-composer-locked-
php-8.3-composer-main
- name: "Install locked dependencies with composer"
uses: "ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
with:
dependencies: "locked"
- name: "Check coding style"
run: "vendor/bin/codecept build"
- name: "Check coding style"
run: "composer cs:check"
- name: "Run static analysis"
run: "composer stan"
tests:
name: "Run codeception tests"
needs: [ qa ]
runs-on: "ubuntu-latest"
strategy:
matrix:
include:
- { php-version: 8.3, dependencies: locked, coverage: pcov, with_coverage: true, allow-fail: false }
- { php-version: 8.4, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true }
- { php-version: 8.5, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true }
steps:
- name: "Checkout"
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
- name: "Install PHP"
uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0
with:
coverage: "${{ matrix.coverage }}"
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
- name: "Cache dependencies installed with composer"
uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: |
php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ github.ref_name }}
php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
php-${{ matrix.php-version }}-composer-main
- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
with:
dependencies: "${{ matrix.dependencies }}"
- name: "Run Tests (coverage)"
if: matrix.with_coverage == true
run: |
vendor/bin/codecept build
vendor/bin/codecept run --coverage --coverage-xml=coverage.xml --xml --report
- name: "Run Tests"
if: matrix.with_coverage != true
run: |
vendor/bin/codecept build
vendor/bin/codecept run --xml --report
- name: "Upload coverage artifact"
if: matrix.with_coverage == true
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: code-coverage-results
path: tests/_output/
retention-days: 5