Skip to content

Commit 54a8c78

Browse files
committed
Copy scripts to .github
1 parent b1a4a81 commit 54a8c78

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

.github/scripts/env_build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
export NODE_OPTIONS='--max-old-space-size=4096' && \
3+
echo "node version: $(node --version)" && \
4+
echo "npm version: $(npm --version)" && \
5+
npm ci && \
6+
npm ls --prod --all

.github/scripts/env_image.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
set -e
3+
# install required fonts
4+
sudo apt-get install fonts-liberation2 fonts-open-sans fonts-noto-cjk fonts-noto-color-emoji
5+
6+
# install additional fonts (committed in .github/fonts/)
7+
sudo cp -r .github/fonts/ /usr/share/
8+
sudo apt install fontconfig
9+
sudo fc-cache -f
10+
11+
# install Kaleido & Plotly
12+
sudo python3 -m pip install kaleido==0.2.1 plotly==6.6.0 --progress-bar off
13+
14+
# install numpy i.e. to convert arrays to typed arrays
15+
sudo python3 -m pip install numpy==1.24.2

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616

1717
- uses: actions/setup-node@v6
1818
with:
19+
# TODO: Update this version to match library
1920
node-version: '18.20.4'
2021
cache: 'npm'
2122

@@ -249,8 +250,8 @@ jobs:
249250
with:
250251
python-version: '3.12'
251252

252-
- name: Install kaleido, plotly.io and required fonts
253-
run: .circleci/env_image.sh
253+
- name: Install Kaleido, plotly.io and required fonts
254+
run: .github/scripts/env_image.sh
254255

255256
- name: Create all png files
256257
run: .github/scripts/test.sh make-baselines
@@ -310,7 +311,7 @@ jobs:
310311
python-version: '3.12'
311312

312313
- name: Install kaleido, plotly.io and required fonts
313-
run: .circleci/env_image.sh
314+
run: .github/scripts/env_image.sh
314315

315316
- name: Create all png files (b64)
316317
run: .github/scripts/test.sh make-baselines-b64
@@ -370,7 +371,7 @@ jobs:
370371
python-version: '3.12'
371372

372373
- name: Install kaleido, plotly.io and required fonts
373-
run: .circleci/env_image.sh
374+
run: .github/scripts/env_image.sh
374375

375376
- name: Create png files (virtual-webgl)
376377
run: .github/scripts/test.sh make-baselines-virtual-webgl
@@ -423,7 +424,7 @@ jobs:
423424
python-version: '3.12'
424425

425426
- name: Install kaleido, plotly.io and required fonts
426-
run: .circleci/env_image.sh
427+
run: .github/scripts/env_image.sh
427428

428429
- name: Create mathjax v3 png files
429430
run: .github/scripts/test.sh make-baselines-mathjax3
@@ -478,7 +479,7 @@ jobs:
478479
python-version: '3.12'
479480

480481
- name: Install kaleido, plotly.io and required fonts
481-
run: .circleci/env_image.sh
482+
run: .github/scripts/env_image.sh
482483

483484
- name: Install poppler-utils for eps export
484485
run: |
@@ -559,7 +560,7 @@ jobs:
559560
cache: 'npm'
560561

561562
- name: Set up build environment
562-
run: .circleci/env_build.sh
563+
run: .github/scripts/env_build.sh
563564

564565
- name: Preview CHANGELOG for next release (only on master)
565566
if: github.ref == 'refs/heads/master'
@@ -617,7 +618,7 @@ jobs:
617618
cache: 'npm'
618619

619620
- name: Set up build environment
620-
run: .circleci/env_build.sh
621+
run: .github/scripts/env_build.sh
621622

622623
- name: Preview CHANGELOG for next release (only on master)
623624
if: github.ref == 'refs/heads/master'
@@ -688,6 +689,7 @@ jobs:
688689
path: stackgl_modules/index.js
689690

690691
test-topojson-build:
692+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
691693
runs-on: ubuntu-latest
692694
steps:
693695
- uses: actions/checkout@v6
@@ -707,7 +709,7 @@ jobs:
707709
run: diff -qr topojson/dist topojson/dist_backup
708710

709711
- uses: actions/upload-artifact@v7
710-
if: always()
712+
if: failure()
711713
with:
712714
name: topojson-dist
713715
retention-days: 7

0 commit comments

Comments
 (0)