-
Notifications
You must be signed in to change notification settings - Fork 4
135 lines (115 loc) · 4.77 KB
/
build-bindings.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
135
name: binding-tests
on:
push:
branches:
- release
- main
pull_request: {}
env:
CONDA_CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
build-tests:
runs-on: ubuntu-latest
steps:
- name: Store Date
shell: bash -l {0}
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Checkout MParT
uses: actions/checkout@v3
with:
path: mpart
- name: Use Conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
use-mamba: true
auto-update-conda: true
python-version: "3.8"
- name: Cache Conda Deps
uses: actions/cache@v3
id: cache-conda
with:
path: /usr/share/miniconda3/envs/test
key: cache-conda-${{ hashFiles('mpart/.github/environment.yml') }}-${{ env.DATE }}-${{ env.CONDA_CACHE_NUMBER }}-BINDINGS
- name: Install Conda Dependencies
shell: bash -l {0}
run: mamba env update -n test -f $GITHUB_WORKSPACE/mpart/.github/environment.yml
if: steps.cache-conda.outputs.cache-hit != 'true'
- name: Setup Julia
run: |
julia -e "using Pkg; Pkg.add([Pkg.PackageSpec(;name=\"CxxWrap\",version=v\"0.14.2\"),Pkg.PackageSpec(;name=\"TestReports\")])"
export GITHUB_JULIA_PATH=$(julia -e "println(DEPOT_PATH[1])")
echo -n $'[bee5971c-294f-5168-9fcd-9fb3c811d495]\nMParT = \"' >> $GITHUB_JULIA_PATH/artifacts/Overrides.toml
echo -n $GITHUB_WORKSPACE >> $GITHUB_JULIA_PATH/artifacts/Overrides.toml
echo -n "/MPART_INSTALL\"" >> $GITHUB_JULIA_PATH/artifacts/Overrides.toml
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Cache Kokkos
uses: actions/cache@v3
id: cache-kokkos
with:
path: "${{ github.workspace }}/KOKKOS_INSTALL"
key: kokkos4.2.00
- if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}}
name: Checkout Kokkos
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
path: kokkos
ref: '4.2.00'
- if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}}
name: Install Kokkos
run: |
cd $GITHUB_WORKSPACE/kokkos
mkdir build && cd build
cmake -DKokkos_ENABLE_THREADS=ON \
-DBUILD_SHARED_LIBS=ON \
-DKokkos_ENABLE_SERIAL=ON \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/KOKKOS_INSTALL/ \
../
sudo make -j2 install
- name: Configure MParT
shell: bash -l {0}
run: |
cd $GITHUB_WORKSPACE/mpart
mkdir build && cd build
cmake -DKokkos_DIR=$GITHUB_WORKSPACE/KOKKOS_INSTALL/lib/cmake/Kokkos \
-DMPART_FETCH_DEPS=OFF \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/MPART_INSTALL/ \
../
- name: Build MParT
shell: bash -l {0}
run: cd $GITHUB_WORKSPACE/mpart/build; make -j2 install
- name: Run Python Tests
continue-on-error: true
shell: bash -l {0}
run: |
export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/MPART_INSTALL/python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/MPART_INSTALL/python:$GITHUB_WORKSPACE/MPART_INSTALL/lib
pytest $GITHUB_WORKSPACE/mpart/bindings/python/tests -v --junitxml="$GITHUB_WORKSPACE/test-results-python.xml"
- name: Run Julia Tests
continue-on-error: true
shell: bash -l {0}
run: |
julia -e "using Pkg; Pkg.add(url=\"https://github.com/MeasureTransport/MParT.jl\"); using TestReports; TestReports.test(\"MParT\",logfilepath=ENV[\"GITHUB_WORKSPACE\"], logfilename=\"test-results-julia.xml\")"
- name: Setup Matlab Tests
continue-on-error: true
shell: bash -l {0}
run: |
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
sed -i "1s|^|addpath(genpath(\'$GITHUB_WORKSPACE/MPART_INSTALL\'))\n|" $GITHUB_WORKSPACE/mpart/bindings/matlab/tests/runtests.m
cat $GITHUB_WORKSPACE/mpart/bindings/matlab/tests/runtests.m
- name: Run Matlab Tests
continue-on-error: true
uses: matlab-actions/run-command@v1
with:
command: addpath('${{ github.workspace }}/mpart/bindings/matlab/tests/'), runtests
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: "Test Results with Bindings"
junit_files: ${{ github.workspace }}/test-results-*.xml