forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (114 loc) · 3.75 KB
/
bokehjs-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
name: BokehJS-CI
on:
push:
branches:
- main
- branch-*
pull_request:
env:
CHROME_VER: "118.0.5993.88"
CHROME_REV: "chromium_2670"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [20.x]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Upgrade npm
shell: bash
run: |
npm install --location=global npm
- name: Install chromium
if: runner.os == 'Linux'
shell: bash
run: |
INSTALLED=$(chromium --version | cut -d' ' -f2 | cut -d'.' -f1-3)
EXPECTED=$(echo "$CHROME_VER" | cut -d'.' -f1-3)
echo "Currently installed Chromium ${INSTALLED}.*; expected ${EXPECTED}.*"
if [[ "$INSTALLED" = "$EXPECTED" ]]; then
echo "Using pre-installed version of chromium"
else
URL=https://github.com/bokeh/chromium/raw/main/linux/$CHROME_VER
wget --no-verbose $URL/$CHROME_REV.assert
wget --no-verbose $URL/$CHROME_REV.snap
sudo snap ack $CHROME_REV.assert
sudo snap install $CHROME_REV.snap
fi
- name: Install dependencies
working-directory: ./bokehjs
shell: bash
run: |
npm ci --no-progress
- name: List installed software
working-directory: ./bokehjs
shell: bash
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
if [ "$RUNNER_OS" == "Linux" ]; then
chromium --version
elif [ "$RUNNER_OS" == "Windows" ]; then
# TODO: this hangs; version is reported in tests
# c:/Program\ Files/Google/Chrome/Application/chrome.EXE --version
echo "Chromium ??? (see tests)"
elif [ "$RUNNER_OS" == "macOS" ]; then
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
fi
npm list
- name: Build bokehjs
working-directory: ./bokehjs
shell: bash
run: |
node make build
- name: Run tests
if: success() || failure()
working-directory: ./bokehjs
shell: bash
run: |
node make test
- name: Lint codebase
if: success() || failure()
working-directory: ./bokehjs
shell: bash
run: |
node make lint
- name: Check repository status
if: success() || failure()
shell: bash
run: |
OUTPUT=$(git status --short bokehjs -- ':!bokehjs/test/baselines')
if [[ ! -z "$OUTPUT" ]]; then echo $OUTPUT; exit 1; fi
- name: Collect results
if: runner.os == 'Linux' && (success() || failure())
shell: bash
run: |
SRC="bokehjs/test/baselines/linux"
DST="bokehjs-report/${SRC}"
mkdir -p ${DST}
if [[ -e ${SRC}/report.json ]];
then
CHANGED=$(git status --short ${SRC}/\*.blf ${SRC}/\*.png | cut -c4-)
cp ${SRC}/report.{json,out} ${CHANGED} ${DST}
fi
- name: Upload package
if: runner.os == 'Linux' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: bokehjs-package
path: bokehjs/build/dist/bokeh-bokehjs-*.tgz
- name: Upload report
if: runner.os == 'Linux' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: bokehjs-report
path: bokehjs-report