-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (154 loc) · 4.91 KB
/
ci.yml
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: CI
# In the future check if Devcontainers should be used to all run the pipeline
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
env:
HUSKY: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
TURBO_CACHE_DIR: .turbo
VRT_BROWSER: chromium
jobs:
build-devcontainer:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Repository to lowercase
id: lowercase-repository
run: |
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Build dev container image
uses: devcontainers/ci@v0.3
with:
configFile: ./.devcontainer/devcontainer-base.json
imageName: ghcr.io/${{ steps.lowercase-repository.outputs.repository }}/devcontainer
cacheFrom: ghcr.io/${{ steps.lowercase-repository.outputs.repository }}/devcontainer
push: always
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Turbo
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turbo-${{ github.sha }}-${{ github.job }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Use pnpm
uses: pnpm/action-setup@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies
# change to pnpm ci once it is implemented
run: |
pnpm i --frozen-lockfile --loglevel warn
pnpm exec playwright install --with-deps chromium
- name: Lint files
run: pnpm run lint --cache-dir=${{ env.TURBO_CACHE_DIR }}
- name: Run tests
run: pnpm run test --cache-dir=${{ env.TURBO_CACHE_DIR }}
- name: Build
run: pnpm run build --cache-dir=${{ env.TURBO_CACHE_DIR }}
vrt:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: 'true'
- name: Pull LFS files
run: git lfs pull
- name: Cache Turbo
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turbo-${{ github.sha }}-${{ github.job }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Use pnpm
uses: pnpm/action-setup@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies
# change to pnpm ci once it is implemented
run: |
pnpm i --frozen-lockfile --loglevel warn
pnpm exec playwright install --with-deps ${{ env.VRT_BROWSER }}
- name: Run tests
run: pnpm run vrt --cache-dir="${{ env.TURBO_CACHE_DIR }}"
- name: Upload report
uses: actions/upload-artifact@v4
if: failure()
with:
name: vrt-report
path: |
apps/*/vrt/report
packages/*/vrt/report
retention-days: 1
e2e:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
browser: [chromium, firefox, webkit]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Restore turbo cache
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turbo-${{ github.sha }}-${{ github.job }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Use pnpm
uses: pnpm/action-setup@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies
# change to pnpm ci once it is implemented
run: |
pnpm i --frozen-lockfile --loglevel warn
pnpm exec playwright install --with-deps ${{ matrix.browser }}
- name: Build
run: pnpm run build --cache-dir=${{ env.TURBO_CACHE_DIR }}
env:
VITE_E2E: true
- name: Run tests
run: pnpm run e2e --force --no-cache -- --project="${{ matrix.browser }}"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: e2e-report-${{ matrix.browser }}
path: apps/*/e2e/results
retention-days: 1