-
Notifications
You must be signed in to change notification settings - Fork 5
137 lines (125 loc) · 4.14 KB
/
Copy pathCI.yml
File metadata and controls
137 lines (125 loc) · 4.14 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
name: CI
on:
push:
branches: [master]
paths-ignore:
- '**/*.md'
- 'documentation/**'
- '.claude/**'
pull_request:
branches: [master]
paths-ignore:
- '**/*.md'
- 'documentation/**'
- '.claude/**'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint-unit-build:
name: Lint, Unit Tests & Build
runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }}
timeout-minutes: 15
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.event.pusher.name != 'web-flow')
env:
NODE_ENV: ${{ vars.APP_ENV || 'development' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- run: npm ci
- run: npm run generateConfig
- run: npm run lint
- run: npm run test:unit:coverage
- run: UV_USE_IO_URING=0 npm run build
env:
DEVKIT_VUE_api_host: https://api.example.com
DEVKIT_VUE_api_port: ""
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
e2e:
name: E2E Tests
runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }}
timeout-minutes: 30
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.event.pusher.name != 'web-flow')
env:
NODE_ENV: ${{ vars.E2E_APP_ENV || vars.APP_ENV || 'test' }}
services:
mongo:
image: mongo:7
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4
with:
path: Vue
- uses: actions/checkout@v4
with:
repository: pierreb-devkit/Node
ref: ${{ vars.E2E_NODE_REF || 'master' }}
path: Node
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: lts/*
# Cache Playwright browsers
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('Vue/package-lock.json') }}
# Cache Vite pre-bundled deps to avoid cold-start re-optimization
- name: Cache Vite deps
uses: actions/cache@v4
with:
path: Vue/node_modules/.vite
key: vite-${{ hashFiles('Vue/package-lock.json') }}
# Install & start Node backend
- name: Install Node backend
working-directory: Node
run: npm ci
- name: Start Node backend
working-directory: Node
run: node server.js > /tmp/node-backend.log 2>&1 &
env:
NODE_ENV: test
DEVKIT_NODE_db_uri: mongodb://127.0.0.1:27017/NodeTest
DEVKIT_NODE_api_port: "3000"
DEVKIT_NODE_organizations_enabled: "true"
DEVKIT_NODE_organizations_autoCreate: "true"
DEVKIT_NODE_organizations_domainMatching: "true"
DEVKIT_NODE_cors_origin: '[http://localhost:8080]'
DEVKIT_NODE_cors_credentials: "true"
- name: Wait for Node backend
run: npx wait-on http://127.0.0.1:3000/api/home --timeout 60000 || (echo "--- Node backend logs ---"; cat /tmp/node-backend.log; exit 1)
# Install & start Vue dev server
- name: Install Vue
working-directory: Vue
run: npm ci
- name: Install Playwright browsers
working-directory: Vue
run: npx playwright install --with-deps chromium
- name: Pre-bundle Vite deps
working-directory: Vue
run: npx vite optimize
- name: Start Vue dev server
working-directory: Vue
run: npm run dev &
- name: Wait for Vue dev server
working-directory: Vue
run: npx wait-on http://localhost:8080 --timeout 60000
# Run E2E tests
- name: Run Playwright tests
working-directory: Vue
run: npx playwright test --config playwright.config.js
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-test-results
path: Vue/test-results/
retention-days: 7