-
Notifications
You must be signed in to change notification settings - Fork 24
94 lines (86 loc) · 2.66 KB
/
build-test.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
name: Build test
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- 'README.md'
- '**.yml'
- 'docs/**'
- 'src/DspConfig.h'
pull_request:
branches:
- master
- release-draft
jobs:
test-github-cpuonly:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
compiler: [gcc, clang]
fail-fast: false
steps:
- name: Install extra libraries
run: |
sudo apt-get update -y
sudo apt-get install -y libtbb-dev libtbb2
if [ ${{ matrix.compiler }} == gcc ]
then
sudo apt-get install -y lcov
fi
- name: Set my secrets
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Checkout DSP
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout DSPThirdPartyLibs
run: |
mkdir -p ~/.ssh
ssh-keyscan git.cels.anl.gov >> ~/.ssh/known_hosts
git clone [email protected]:kimk/DSPThirdPartyLibs.git
- name: Run cmake and build
env:
CC: ${{ matrix.compiler }}
FC: gfortran-12
run: |
cd DSPThirdPartyLibs
./github.sh
export MA27LIB_DIR=$PWD/ma27/build/lib
export SCIPOPT_INC_DIR=$PWD/include
export SCIPOPT_LIB_DIR=$PWD/lib
export CPLEX_INC_DIR=$PWD/cplex/ilcplex
export CPLEX_LIB_DIR=$PWD/cplex/lib
echo "Checking the environment variables:"
echo $MA27LIB_DIR
echo $SCIPOPT_INC_DIR
echo $SCIPOPT_LIB_DIR
echo $CPLEX_INC_DIR
echo $CPLEX_LIB_DIR
export LD_LIBRARY_PATH=$SCIPOPT_LIB_DIR:$(dirname `$FC --print-file-name libgfortran.so`):$LD_LIBRARY_PATH
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
cd ..
mkdir build
cd build
if [ ${{ matrix.compiler }} == gcc ]; then export CXX=g++; fi
if [ ${{ matrix.compiler }} == clang ]; then export CXX=clang++; fi
cmake .. -DUNIT_TESTING=OFF -DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=DEBUG
make -j
make install
- name: Run test
run: |
export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }}
cd build
ctest
if [ ${{ matrix.compiler }} == gcc ]
then
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
fi
- uses: codecov/codecov-action@v1
with:
file: ./build/coverage.info