-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (48 loc) · 1.62 KB
/
build.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
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: korp-frontend
strategy:
matrix:
# From lowest supported version up to the one pinned in .nvmrc
# The empty string enables the `node-version-file` option which reads from .nvmrc
node-version: [18, 20, ""]
steps:
- name: Checkout main repo
uses: actions/checkout@v4
with:
path: korp-frontend
- name: Checkout Språkbanken config repo
uses: actions/checkout@v4
with:
repository: spraakbanken/korp-frontend-sb
token: ${{ secrets.ACCESS_TOKEN }}
ref: ${{ github.ref == 'master' && 'master' || 'dev' }} # Choose dev or master matching the main repo.
path: korp-frontend-sb
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version-file: korp-frontend/.nvmrc
- name: Install dependencies
run: yarn install
- name: Link config
run: |
echo '{"configDir": "../korp-frontend-sb/app"}' > run_config.json
- name: Build
run: yarn build
- name: Install Playwright browsers
run: yarn playwright install --with-deps
- name: Run e2e tests
run: yarn test
- name: Save test report
uses: actions/upload-artifact@v4
if: ${{ !success() }}
with:
name: playwright-report${{ matrix.node-version }}
path: korp-frontend/playwright-report/
retention-days: 30