-
Notifications
You must be signed in to change notification settings - Fork 11
70 lines (62 loc) · 1.42 KB
/
linux.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
name: CI - Linux via CMake
on:
push:
branches:
- main
- devel
- 'topic/**'
pull_request:
workflow_dispatch:
workflow_call:
env:
CCACHE_DIR: ~/.ccache
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_PARALLEL_LEVEL: 4
NJOBS: 8
defaults:
run:
shell: bash -leo pipefail {0} {0}
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/cache@v3
with:
key: ${{ runner.os }}
path: ${{ env.CCACHE_DIR }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Build and install proxnlp
run: |
micromamba activate
cd $GITHUB_WORKSPACE
mkdir build && cd build
cmake .. -DBUILD_DOCUMENTATION=OFF \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_BUILD_TYPE=Release
make -j$NJOBS install
python3 -c "import proxnlp"
- name: Run tests
run: |
micromamba activate
micromamba install pytest casadi -y
cd $GITHUB_WORKSPACE
echo "CURRENT DIRECTORY IS $PWD"
cd build && ctest
cleanup:
name: Cleanup
needs: build
runs-on: self-hosted
if: always()
steps:
- run: |
cd $GITHUB_WORKSPACE
if [ -d build ]; then
cd build/
make uninstall || echo "No uninstall target found"
cd .. && rm -rf build/
else
echo "build-dir did not exist"
fi