-
Notifications
You must be signed in to change notification settings - Fork 75
126 lines (124 loc) · 3.39 KB
/
main.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
name: Build and test
on:
push:
# branches:
# - master
pull_request:
branches:
- master
release:
types:
- created
schedule:
- cron: "0 7 * * 1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- uses: browser-actions/setup-firefox@latest
- run: sudo apt-get install --yes --no-install-recommends optipng imagemagick
- run: sudo apt-get remove --yes fonts-lato
- run: fc-list
- run: firefox --version
- run: google-chrome --version
- run: npm ci
- run: npm run setup-website
- run: npm run ci-xvfb
- run: npm run ci-build-website
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: On failure, create alternate baseline images in case the new behavior is correct
if: ${{ failure() }}
run: |
pip3 install girder_client
python3 tests/runners/baseline_images.py -cevb _build
- name: Upload test images on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: images
path: |
_build/images
_build/Baseline*tgz
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/apidocs
dist/built
- name: Upload built website
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: website
path: |
website/public
unpinned:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Don't pin version to test with the latest common version
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm --version && node --version
- uses: browser-actions/setup-firefox@latest
- run: sudo apt-get install --yes --no-install-recommends optipng imagemagick
- run: sudo apt-get remove --yes fonts-lato
- run: fc-list
- run: firefox --version
- run: google-chrome --version
# Delete the package-lock to test with the latest libraries allowed
- run: rm package-lock.json
- run: npm install
- run: npm audit --audit-level high
- run: npm run setup-website
- run: npm run ci-xvfb
- run: npm run ci-build-website
deploy-website:
if: ${{ github.ref == 'refs/heads/master' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Import artifacts
uses: actions/download-artifact@v4
with:
name: website
path: website/public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: website/public
force_orphan: true
deploy-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- name: Import artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Install semantic-release
run: npm install semantic-release --no-save
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release