1- on : [ push, pull_request ]
1+ on :
2+ push :
3+ branches :
4+ - " main"
5+ pull_request :
6+
27name : " CI"
38
49jobs :
5- qa :
6- name : " QA (lint + static analysis)"
7- if : " !startsWith(github.event.head_commit.message, 'chore(release)')"
8- runs-on : " ubuntu-latest"
9- env :
10- PHP_CS_FIXER_IGNORE_ENV : true
11- steps :
12- - name : " Checkout"
13- uses : " actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
14-
15- - name : " Install PHP"
16- uses : " shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0
17- with :
18- coverage : " none"
19- php-version : " 8.3"
20-
21- - name : " Validate composer.json and composer.lock"
22- run : " composer validate --ansi --strict"
23-
24- - name : " Determine composer cache directory"
25- uses : " ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
26-
27- - name : " Cache dependencies installed with composer"
28- uses : " actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4
29- with :
30- path : " ${{ env.COMPOSER_CACHE_DIR }}"
31- key : " php-8.3-composer-locked-${{ hashFiles('composer.lock') }}"
32- restore-keys : |
33- php-8.3-composer-locked-${{ github.ref_name }}
34- php-8.3-composer-locked-
35- php-8.3-composer-main
36-
37- - name : " Install locked dependencies with composer"
38- uses : " ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
39- with :
40- dependencies : " locked"
41-
42- - name : " Check coding style"
43- run : " vendor/bin/codecept build"
44-
45- - name : " Check coding style"
46- run : " composer cs:check"
47-
48- - name : " Run static analysis"
49- run : " composer stan"
50-
51- tests :
52- name : " Run codeception tests"
53- needs : [ qa ]
54- runs-on : " ubuntu-latest"
55- strategy :
56- matrix :
57- include :
58- - { php-version: 8.3, dependencies: locked, coverage: pcov, with_coverage: true, allow-fail: false }
59-
60- - { php-version: 8.4, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true }
61- - { php-version: 8.5, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true }
62- steps :
63- - name : " Checkout"
64- uses : " actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
65-
66- - name : " Install PHP"
67- uses : " shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0
68- with :
69- coverage : " ${{ matrix.coverage }}"
70- ini-values : display_errors=On, display_startup_errors=On, error_reporting=32767
71- php-version : " ${{ matrix.php-version }}"
72-
73- - name : " Set up problem matchers for PHP"
74- run : " echo \" ::add-matcher::${{ runner.tool_cache }}/php.json\" "
75-
76- - name : " Set up problem matchers for phpunit/phpunit"
77- run : " echo \" ::add-matcher::${{ runner.tool_cache }}/phpunit.json\" "
78-
79- - name : " Validate composer.json and composer.lock"
80- run : " composer validate --ansi --strict"
81-
82- - name : " Determine composer cache directory"
83- uses : " ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
84-
85- - name : " Cache dependencies installed with composer"
86- uses : " actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4
87- with :
88- path : " ${{ env.COMPOSER_CACHE_DIR }}"
89- key : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
90- restore-keys : |
91- php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ github.ref_name }}
92- php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
93- php-${{ matrix.php-version }}-composer-main
94-
95- - name : " Install ${{ matrix.dependencies }} dependencies with composer"
96- uses : " ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
97- with :
98- dependencies : " ${{ matrix.dependencies }}"
99-
100- - name : " Run Tests (coverage)"
101- if : matrix.with_coverage == true
102- run : |
103- vendor/bin/codecept build
104- vendor/bin/codecept run --coverage --coverage-xml=coverage.xml --xml --report
105-
106- - name : " Run Tests"
107- if : matrix.with_coverage != true
108- run : |
109- vendor/bin/codecept build
110- vendor/bin/codecept run --xml --report
111-
112- - name : " Upload coverage artifact"
113- if : matrix.with_coverage == true
114- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
115- with :
116- name : code-coverage-results
117- path : tests/_output/
118- retention-days : 5
10+ ci :
11+ uses : " WebProject-xyz/.github/.github/workflows/ci.yml@main"
12+ secrets : inherit
13+ with :
14+ php-cs-fixer-ignore-env : true
0 commit comments