Repository navigation
159 lines (127 loc) · 4.49 KB
/
Copy pathtest.yml
File metadata and controls
159 lines (127 loc) · 4.49 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
name: Test & Verify
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test & Verify Build (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# package.json engines: ^22.22.2 || >=24.15.0
node-version: ['22', '24']
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Lint
run: npm run lint
- name: Check formatting
run: npm run format:check
- name: Run regression test suite
run: npm test
- name: Dependency gate unit tests
run: node --test .github/scripts/dependency-gate.test.mjs
- name: Showcase script unit tests
run: node --test .github/scripts/showcase.test.mjs
- name: Admin StrictMode tests (React 18)
run: npm run test:admin
- name: Type checks
run: |
npm run test:ts:front
npm run test:ts:back
- name: Build plugin
run: npm run build
- name: Verify plugin integrity
run: npm run verify
- name: Verify server runtime bundle
run: npm run verify:runtime
- name: Verify build output
run: |
test -f dist/admin/index.js
test -f dist/admin/index.mjs
test -f dist/server/index.js
test -f dist/server/index.mjs
- name: Check file structure
run: |
test -d admin/src
test -d server/src
test -f package.json
test -f .releaserc.json
test -f README.md
test -f LICENSE
react-19:
# Informational: the peer range is React ^18, like the Strapi 5 admin, and stays so. This job
# runs the admin StrictMode tests against React 19 (RFC strapi/strapi#25739) to see problems
# before Strapi moves; a failure here does not block a pull request.
name: Admin StrictMode tests on React 19 (informational)
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install React 19 (not saved)
run: npm install --no-save --legacy-peer-deps --ignore-scripts react@19 react-dom@19
- name: Show installed React version
run: node -p "'react ' + require('react/package.json').version + ', react-dom ' + require('react-dom/package.json').version"
- name: Admin StrictMode tests (React 19)
run: npm run test:admin
peer-floor:
# peerDependencies say @strapi/strapi ^5.57.0: prove the lowest supported version, not only
# the acceptance version in the lockfile.
name: Lowest supported Strapi (5.57.0)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Install Strapi 5.57.0
run: npm install --no-save --legacy-peer-deps --ignore-scripts @strapi/strapi@5.57.0 @strapi/utils@5.57.0 @strapi/typescript-utils@5.57.0
- name: Show installed Strapi version
run: node -p "require('@strapi/strapi/package.json').version"
- name: Type checks, tests, build and verify
run: |
npm run test:ts:back
npm run test:ts:front
npm test
npm run build
npm run verify
npm run verify:runtime