-
Notifications
You must be signed in to change notification settings - Fork 75
142 lines (140 loc) · 4.19 KB
/
main.yml
File metadata and controls
142 lines (140 loc) · 4.19 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
name: Build and test
on:
push:
# branches:
# - master
pull_request:
branches:
- master
release:
types:
- created
schedule:
- cron: "0 7 * * 1"
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '20'
- uses: browser-actions/setup-firefox@latest
- run: sudo apt-get update
- run: sudo apt-get install --yes --no-install-recommends optipng imagemagick build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev liblzma-dev
- 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 validate-es5
- run: npm run ci-build-website
- uses: codecov/codecov-action@v5
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@v6
with:
name: images
path: |
_build/images
_build/Baseline*tgz
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: dist
path: |
dist/apidocs
dist/built
- name: Upload built website
if: ${{ success() }}
uses: actions/upload-artifact@v6
with:
name: website
path: |
website/public
unpinned:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Don't pin version to test with the latest common version
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- run: npm --version && node --version
- uses: browser-actions/setup-firefox@latest
- run: sudo apt-get update
- run: sudo apt-get install --yes --no-install-recommends optipng imagemagick build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev liblzma-dev
- 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@v6
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@v6
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: sudo apt-get update
- run: sudo apt-get install --yes --no-install-recommends optipng imagemagick build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev liblzma-dev
- name: Import artifacts
uses: actions/download-artifact@v6
with:
name: dist
path: dist
- name: Copy built artifacts into package root (skip rebuild)
run: |
if [ -d "dist/built" ]; then
cp -a dist/built/. .
else
echo "ERROR: dist/built not found; aborting publish"
exit 1
fi
- name: Install semantic-release
run: npm install semantic-release --no-save
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_IGNORE_SCRIPTS: 'true'
run: npx semantic-release