-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (138 loc) · 3.67 KB
/
Copy pathci.yml
File metadata and controls
170 lines (138 loc) · 3.67 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
169
170
name: CI
on:
push:
branches: ["**"]
pull_request:
permissions:
contents: read
deployments: write
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Unit Tests
run: npm run test -- --run
browser-smoke:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Browser Smoke Test
run: npm run test:browser
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright Browser
run: npx playwright install --with-deps chromium
- name: Playwright E2E
run: npm run test:e2e
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
env:
VITE_MAPTILER_API_KEY: ${{ secrets.VITE_MAPTILER_API_KEY }}
run: npm run build
- name: Upload production bundle
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: production-bundle-${{ github.sha }}
path: dist
if-no-files-found: error
retention-days: 1
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- typecheck
- lint
- unit-tests
- browser-smoke
- e2e
- build
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: formation-map-editor-production
cancel-in-progress: false
steps:
- name: Check out verified commit
uses: actions/checkout@v4
- name: Download verified production bundle
uses: actions/download-artifact@v4
with:
name: production-bundle-${{ github.sha }}
path: dist
- name: Deploy exact commit to Cloudflare Pages
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: "4"
command: pages deploy dist --project-name=formation-map-editor --branch=main --commit-hash=${{ github.sha }} --commit-dirty=false