-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (116 loc) · 3.57 KB
/
run-tests.yaml
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
on:
push:
branches:
- master
pull_request:
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
container: rocker/r-base:latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Cache RDS files
id: cache-rds
uses: actions/cache@v4
with:
path: tests/rds/*.rds
key: rds-${{ hashFiles('tests/rds/generate.R') }}
- name: Build RDS files
if: steps.cache-rds.outputs.cache-hit != 'true'
run: |
cd tests/rds
R -f generate.R
build_deps:
runs-on: ubuntu-latest
needs: [prepare-version]
container: ghcr.io/kanaverse/emcmake-docker/builder:${{ needs.prepare-version.outputs.version }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Cache installed
id: installed
uses: actions/cache@v4
with:
path: extern/installed
key: deps-${{ hashFiles('extern/**/build.sh') }}-${{ env.IMAGE_VERSION }}
- name: Build HDF5
if: steps.installed.outputs.cache-hit != 'true'
run: |
cd extern/hdf5
./build.sh
- name: Build igraph
if: steps.installed.outputs.cache-hit != 'true'
run: |
cd extern/igraph
./build.sh
test:
runs-on: ubuntu-latest
needs: [ create_rds, build_deps, prepare-version]
container: ghcr.io/kanaverse/emcmake-docker/builder:${{ needs.prepare-version.outputs.version }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache Modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: npm-${{ hashFiles('package.json') }}
- name: Update NPM packages
run: npm i --include=dev
- name: Cache installed
uses: actions/cache@v4
with:
path: extern/installed
key: deps-${{ hashFiles('extern/**/build.sh') }}-${{ env.IMAGE_VERSION }}
- name: Cache RDS files
uses: actions/cache@v4
with:
path: tests/rds/*.rds
key: rds-${{ hashFiles('tests/rds/generate.R') }}
- name: Cache node build
id: wasm-build
uses: actions/cache@v4
with:
path: js/wasm
key: wasm-${{ hashFiles('build.sh', 'extern/**/build.sh', 'CMakeLists.txt', 'extern/CMakeLists.txt', 'src/*') }}-${{ env.IMAGE_VERSION }}
- name: Update node build
if: steps.wasm-build.outputs.cache-hit != 'true'
run: bash build.sh main
- name: Check all transitive dependencies are pinned
if: steps.wasm-build.outputs.cache-hit != 'true'
shell: /bin/bash -e {0}
run: |
cat extern/CMakeLists.txt | \
grep "FetchContent_MakeAvailable" | \
sed "s/FetchContent_MakeAvailable(//" | \
sed "s/)//" | \
tr '[:upper:]' '[:lower:]' | \
sort > requested.txt
ls build_main/_deps/ | \
grep "src$" | \
sed "s/-src//" | \
sort > observed.txt
diffs=$(diff observed.txt requested.txt )
if [[ $diffs != '' ]]
then
exit 1
fi
- name: Run tests
run: |
export CHECK_RDS=1
npm run test