-
Notifications
You must be signed in to change notification settings - Fork 28
168 lines (140 loc) · 6.06 KB
/
Copy pathci.yml
File metadata and controls
168 lines (140 loc) · 6.06 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
162
163
164
165
166
167
168
#=======================================================================================================================
name: CI
run-name: "[CI] requested by @${{ github.actor }} on ${{ github.event_name }}"
#-----------------------------------------------------------------------------------------------------------------------
# This workflow defines all required CI execution and test runs required
# to ensure quality for this extension. This may be extended over time.
#
# Note that it is on purpose to not containing a `scheduled` run in here,
# because this will done using `workflow_dispatch` by `scheduled-*.yml`.
# It is absolute required to have for all dispatched branch execution
# this ci.yaml file for the main ci checks in place.
#=======================================================================================================================
on:
push:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
jobs:
#---------------------------------------------------------------------------------------------------------------------
# Code quality provides low-level and quick executable checks to fail early before
# executing more costly tool executions like unit, functional or acceptance tests.
#---------------------------------------------------------------------------------------------------------------------
code-quality:
name: "code quality insurance"
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2', '8.3' , '8.4' , '8.5' ]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Composer install
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- install
- name: Lint PHP
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lintPhp
- name: CGL
if: ${{ matrix.php <= '8.3' }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s cgl -n
- name: Phpstan
if: ${{ matrix.php <= '8.3' }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s phpstan
#---------------------------------------------------------------------------------------------------------------------
# Quick tests provide immediate feedback on basic functionality
#---------------------------------------------------------------------------------------------------------------------
quick-tests:
name: "Quick Tests (PHP ${{ matrix.php }})"
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2', '8.3' ]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Composer install
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- install
- name: Install container extension for testing
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- require b13/container:^3.0 --dev --no-interaction
- name: Unit tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit
timeout-minutes: 5
- name: Functional tests (SQLite)
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s functional -d sqlite
timeout-minutes: 10
#---------------------------------------------------------------------------------------------------------------------
# JavaScript tests validate frontend functionality
#---------------------------------------------------------------------------------------------------------------------
javascript-tests:
name: "JavaScript Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'npm'
- name: Install JavaScript dependencies
run: npm ci
- name: Run JavaScript tests
run: npm test -- --reporter=verbose
#---------------------------------------------------------------------------------------------------------------------
# Extended tests - focus on reliability over comprehensive database testing
#---------------------------------------------------------------------------------------------------------------------
tests-extended:
name: "Extended Tests (PHP ${{ matrix.php }})"
runs-on: ubuntu-latest
needs: [quick-tests]
strategy:
matrix:
php: [ '8.2', '8.3' ]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js for JavaScript tests
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'npm'
- name: Install JavaScript dependencies
run: npm ci
- name: Composer install
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- install
- name: Install container extension for testing
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- require b13/container:^3.0 --dev --no-interaction
- name: Run extended functional tests with SQLite (reliable)
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s functional -d sqlite
timeout-minutes: 15
- name: Run JavaScript tests
run: npm test -- --reporter=verbose
timeout-minutes: 5
documentation:
name: "Extension documentation"
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Render documentation
run: Build/Scripts/runTests.sh -s renderDocumentation
- uses: actions/upload-artifact@v6
id: artifact-upload-step
with:
name: rendered-documentation-folder
path: Documentation-GENERATED-temp/
compression-level: 9
if-no-files-found: error
retention-days: 90
overwrite: true
# @todo Add unit test execution after use-full tests has been added
# @todo Add functional test execution after use-full tests has been added
# @todo Add acceptance test execution after use-full tests has been added along with infrastructure and setup