forked from jbengtsson/thor-scsi-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 3.96 KB
/
cmake-single-platform.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
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: build and test, c++ and python part
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
# cmake is used to install file ... defaults to /usr/local
LD_LIBRARY_PATH: /usr/local/lib
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:
- name: checkout thor-scsi-lib code
uses: actions/checkout@v3
with:
submodules: True
- name: checkout gtpsa-cpp repo
uses: actions/checkout@v4
with:
repository: hz-b/gtpsa-cpp
path: gtpsa-cpp
ref: main
submodules: True
- name: install apt dependencies
run: |
sudo apt-get update
# gfortran ... currently for mad-ng gtpsa library
sudo apt-get install g++ gfortran cmake make bison flex libarmadillo-dev
# deliberatly only installing a subset of boost
sudo apt-get install libboost-chrono-dev libboost-thread-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-test-dev
# for building the python interface ... hopefully python3-xarray is not needed this is rather heavy
sudo apt-get install pybind11-dev python3-pytest python3-pip python3-pybind11
- name: Configure cmake for gtpsa-cpp
run: cmake gtpsa-cpp -B ${{github.workspace}}/gtpsa-cpp/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build gtpsa-cpp
run: cmake --build ${{github.workspace}}/gtpsa-cpp/build --config ${{env.BUILD_TYPE}}
- name: Install gtpsa-cpp
# need to be root to install ?
run: sudo cmake --install ${{github.workspace}}/gtpsa-cpp/build
- 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_PREFIX_PATH=/usr/local/lib/cmake/ cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build with cmake
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test cpp part
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
- name: Install thor-scsi-lib
# need to be root to install ?
run: sudo cmake --install ${{github.workspace}}/build
- name : gtpsa build and install python package
# need to do that here as it is not yet a python wheel
run: gtpsa_PREFIX=/usr/local pip3 install -v gtpsa-cpp/python
- name : thor-scsi-lib build and install python package
run: gtpsa_PREFIX=/usr/local thor_scsi_PREFIX=/usr/local pip3 install -v ./python/
- name: install apt test dependencies
run: |
# xarray are heavy packages ... deliberatley only installed here
# as required for the tests
sudo apt-get install python3-pandas python3-scipy python3-xarray
- name : thor-scsi-lib test python package
# consider removing tests ....
# so more tests will be run
# bba_test needs scikit-learn ... don't want to blow that image
run: pytest-3 python/tests/