-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (78 loc) · 3.35 KB
/
cmake.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
name: Build and Run Tests
on: [pull_request, workflow_dispatch]
env:
# Customize the CMake build type here (Release, Debug, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install C/C++ Libraries
run: |
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install libsvm-dev
sudo apt-get install libomp-dev
sudo apt-get install libthrift-dev
sudo apt-get install libgsl-dev
sudo apt-get install libboost-dev
sudo apt-get install libboost-graph-dev
sudo apt-get install libboost-regex-dev
sudo apt-get install libreadline-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/${{env.BUILD_TYPE}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
- name: Run C++ Tests
working-directory: ${{github.workspace}}/${{env.BUILD_TYPE}}
# Execute c++ based tests
run: tests/unit_tests
- name: Add conda to system path
# Miniconda is already installed on Github Actions runners
# $CONDA is an environment variable pointing to the root of the
# miniconda directory.
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install Python Test Dependencies
working-directory: ${{github.workspace}}
# Install python libraries to "base" conda env which is used by default
run: |
conda env update --name base --file scripts/seek/conda_environment.yml
- name: Load SampleBC Cache
# Caches and reuses the sampleBC DB used in the SEEK python tests.
# The tests check is the DB files exist and if they don't it
# rebuilds them, which would then be cached for future runs.
uses: actions/cache@v2
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 2
with:
path: ${{github.workspace}}/tests/test_outputs/sampleBC
key:
seek_cache-${{ runner.os }}-${{ env.CACHE_NUMBER }}-${{
hashFiles('scripts/seek/seekCreateDB.py') }}-${{
hashFiles('scripts/seek/seekUtils.py') }}
- name: Test SEEK Tools
# Execute python based tests
working-directory: ${{github.workspace}}
run: |
python -m pytest -s -v tests/
- name: Test SEEK Scripts
# Execute python based tests
working-directory: ${{github.workspace}}
run: |
# $CONDA/bin/activate base
python -m pytest -s -v scripts/seek/tests/