-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (124 loc) · 3.36 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
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
name: Test
on:
push:
branches:
- '**'
- '!gh_pages'
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build-ui:
name: UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- name: install voyager dependencies
run: (cd source/voyager && npm ci --legacy-peer-deps)
- name: install ui dependencies
run: npm ci && (cd source/ui && npm ci)
- name: build UI
run: npm run build-ui
- uses: actions/upload-artifact@v4
with:
name: "client"
path: "dist"
if-no-files-found: error
retention-days: 1
build-server:
name: Server
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20, 22]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: install
run: npm ci && (cd source/server && npm ci)
- name: test
run: (cd source/server && npm test)
- name: build
run: npm run build-server
- uses: actions/upload-artifact@v4
if: matrix.node-version == 22
with:
name: "server"
path: |
source/server/dist/*
!source/server/dist/*.test.js
!source/server/dist/*.test.js.map
!source/server/dist/__test_fixtures/**
source/server/package.json
source/server/package-lock.json
source/server/migrations/
source/server/templates/
source/server/LICENSE.md
retention-days: 1
pack:
name: Pack tarball
runs-on: ubuntu-latest
needs: [build-ui, build-server]
steps:
- uses: actions/download-artifact@v4
with:
path: eCorpus
- name: edit run scripts
working-directory: eCorpus
run: |
mv server/* ./
rm -r server
- uses: actions/upload-artifact@v4
with:
name: "eCorpus-${{github.ref_name}}"
path: eCorpus
if-no-files-found: error
retention-days: 10
e2e:
name: Test End-to-End
runs-on: ubuntu-latest
needs: [ pack ]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
source/e2e
- uses: actions/download-artifact@v4
with:
name: "eCorpus-${{github.ref_name}}"
path: build
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: install dependencies
run: |
ls
ls build/*
npm ci
(cd build && npm ci --omit=dev)
(cd source/e2e && npm ci)
(cd source/e2e && npx playwright install --with-deps)
- name: run tests
working-directory: source/e2e
env:
ROOT_DIR: "${{ github.workspace}}/build"
DIST_DIR: "${{ github.workspace}}/build/client"
run: npm test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: source/e2e/playwright-report/
retention-days: 10