Skip to content

Commit

Permalink
Improved the scripts and the actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Oct 2, 2024
1 parent 7cf0054 commit 4c2558a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ on:

name: Test JS bindings

env:
IMAGE_VERSION: master

jobs:
prepare-version:
runs-on: ubuntu-latest
steps:
- run: echo "null"
outputs:
version: ${{ env.IMAGE_VERSION }}

# Building the RDS files for the various RDS-reading utilities.
create_rds:
runs-on: ubuntu-latest
Expand All @@ -22,14 +32,15 @@ jobs:
R -f generate.R
- name: Upload RDS files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rds-files
path: tests/rds/*.rds

build_deps:
runs-on: ubuntu-latest
container: ghcr.io/kanaverse/emcmake-docker/builder:2024-10-01
needs: [prepare-version]
container: ghcr.io/kanaverse/emcmake-docker/builder:${{ needs.prepare-version.outputs.version }}

steps:
- name: Checkout repo
Expand All @@ -40,7 +51,7 @@ jobs:
uses: actions/cache@v4
with:
path: extern/installed
key: deps-${{ hashFiles('**/extern/**/build.sh') }}
key: deps-${{ hashFiles('**/extern/**/build.sh') }}-${{ env.IMAGE_VERSION }}

- name: Build HDF5
if: steps.installed.outputs.cache-hit != 'true'
Expand All @@ -56,8 +67,8 @@ jobs:
test:
runs-on: ubuntu-latest
needs: [ create_rds, build_deps ]
container: ghcr.io/kanaverse/emcmake-docker/builder:2024-10-01
needs: [ create_rds, build_deps, prepare-version]
container: ghcr.io/kanaverse/emcmake-docker/builder:${{ needs.prepare-version.outputs.version }}

steps:
- name: Checkout repo
Expand All @@ -67,7 +78,7 @@ jobs:
uses: actions/cache@v4
with:
path: extern/installed
key: deps-${{ hashFiles('**/extern/**/build.sh') }}
key: deps-${{ hashFiles('**/extern/**/build.sh') }}-${{ env.IMAGE_VERSION }}

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -81,7 +92,7 @@ jobs:
run: npm i --include=dev

- name: Download RDS files
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: rds-files
path: tests/rds
Expand Down
7 changes: 5 additions & 2 deletions extern/hdf5/build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/bash

set -e
set -u

HDF5_VERSION=1.14.5
HDF5_HASH=ec2e13c52e60f9a01491bb3158cb3778c985697131fc6a342262d32a26e58e44
SOURCE_DIR=hdf5-${HDF5_VERSION}

if [[ ! -e ${SOURCE_DIR} ]]
then
wget https://github.com/HDFGroup/hdf5/releases/download/hdf5_${HDF5_VERSION}/hdf5-${HDF5_VERSION}.tar.gz -O hdf5.tar.gz
wget -q https://github.com/HDFGroup/hdf5/releases/download/hdf5_${HDF5_VERSION}/hdf5-${HDF5_VERSION}.tar.gz -O hdf5.tar.gz
OBSERVED_HASH=($(shasum -a 256 hdf5.tar.gz))
if [[ ${OBSERVED_HASH} != ${HDF5_HASH} ]]
then
echo "hash mismatch for ${HDF5_VERSION} (got ${OBSERVED_HASH})"
exit 1
fi
tar -xvf hdf5.tar.gz
tar -xf hdf5.tar.gz

# Some source-editing shenanigans are required to deal with the lack of
# FE_INVALID in Emscripten, see emscripten-core/emscripten#22005. Hey,
Expand Down
7 changes: 5 additions & 2 deletions extern/igraph/build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/bash

set -e
set -u

IGRAPH_VERSION=0.10.13
IGRAPH_HASH=c6dc44324f61f52c098bedb81f6a602365d39d692d5068ca4fc3734b2a15e64c
SOURCE_DIR=igraph-${IGRAPH_VERSION}

if [[ ! -e ${SOURCE_DIR} ]]
then
wget https://github.com/igraph/igraph/releases/download/${IGRAPH_VERSION}/igraph-${IGRAPH_VERSION}.tar.gz -O igraph.tar.gz
wget -q https://github.com/igraph/igraph/releases/download/${IGRAPH_VERSION}/igraph-${IGRAPH_VERSION}.tar.gz -O igraph.tar.gz
OBSERVED_HASH=($(shasum -a 256 igraph.tar.gz))
if [[ ${OBSERVED_HASH} != ${IGRAPH_HASH} ]]
then
echo "hash mismatch for ${IGRAPH_VERSION} (got ${OBSERVED_HASH})"
exit 1
fi
tar -xvf igraph.tar.gz
tar -xf igraph.tar.gz
fi

BUILD_DIR=build-${IGRAPH_VERSION}
Expand Down

0 comments on commit 4c2558a

Please sign in to comment.