blob: 25e745e53b5a526f435138dbe1c0548c7730e65c (
plain) (
blame)
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
|
name: Test
on:
pull_request:
workflow_dispatch:
jobs:
test:
name: Basic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: |
package-lock.json
playground/package-lock.json
- name: Install root deps
run: npm ci
- name: Build plugin
run: npm run build
- name: Verify plugin
run: npm run verify
- name: Pack plugin into playground .yalc
run: |
TARBALL=$(npm pack --silent)
mkdir -p playground/.yalc/strapi-plugin-checkbox-list
tar -xzf "$TARBALL" -C playground/.yalc/strapi-plugin-checkbox-list --strip-components=1
- name: Install playground deps
run: npm ci --prefix playground
- name: Build playground
run: npm run build --prefix playground
- name: Integration tests (Jest + Supertest)
run: npm run test:integration --prefix playground
e2e:
name: E2E
runs-on: ubuntu-latest
needs: test
env:
STRAPI_ADMIN_EMAIL: admin@example.com
STRAPI_ADMIN_PASSWORD: Admin12345
STRAPI_ADMIN_FIRSTNAME: Admin
STRAPI_ADMIN_LASTNAME: User
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: |
package-lock.json
playground/package-lock.json
- name: Install root deps
run: npm ci
- name: Build plugin
run: npm run build
- name: Pack plugin into playground .yalc
run: |
TARBALL=$(npm pack --silent)
mkdir -p playground/.yalc/strapi-plugin-checkbox-list
tar -xzf "$TARBALL" -C playground/.yalc/strapi-plugin-checkbox-list --strip-components=1
- name: Install playground deps
run: npm ci --prefix playground
- name: Create admin user
run: |
cd playground
npx strapi admin:create-user \
--email "$STRAPI_ADMIN_EMAIL" \
--password "$STRAPI_ADMIN_PASSWORD" \
--firstname "$STRAPI_ADMIN_FIRSTNAME" \
--lastname "$STRAPI_ADMIN_LASTNAME"
- name: Start Strapi
run: |
npm run develop --prefix playground -- --host 0.0.0.0 --port 1337 &
echo $! > /tmp/strapi.pid
until curl -sSf http://127.0.0.1:1337/admin >/dev/null; do sleep 2; done
- name: E2E tests (Playwright/Cypress)
run: npm run e2e --prefix playground
- name: Stop Strapi
if: always()
run: |
if [ -f /tmp/strapi.pid ]; then
kill "$(cat /tmp/strapi.pid)" || true
fi
|