-
Notifications
You must be signed in to change notification settings - Fork 116
133 lines (110 loc) · 3.86 KB
/
coverage.yml
File metadata and controls
133 lines (110 loc) · 3.86 KB
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
name: coveralls
on:
push:
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
GTEST_REF: b85864c64758dec007208e56af933fc3f52044ee
ORTOOLS_VER: "9.14"
jobs:
coveralls-on-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Test cmake version
run: cmake --version
- name: Set relative paths
run: |
GTEST=$GITHUB_WORKSPACE/googletest
echo "GTEST=$GTEST" >> $GITHUB_ENV
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
ORTOOLSDIR=$GITHUB_WORKSPACE/or-tools-$ORTOOLS_VER/install_release
echo "ORTOOLSDIR=$ORTOOLSDIR" >> $GITHUB_ENV
- name: Install OS dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y \
lcov
- name: Restore cached OR-Tools
id: cached-ortools-restore
uses: actions/cache/restore@v4
with:
key: ortools-${{env.ORTOOLS_VER}}-linux-debug
path: ${{env.ORTOOLSDIR}}/
- name: Download OR-Tools
if: steps.cached-ortools-restore.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L https://github.com/google/or-tools/releases/download/v$ORTOOLS_VER/or-tools-$ORTOOLS_VER.tar.gz -o or-tools-$ORTOOLS_VER.tar.gz
tar xvzf or-tools-$ORTOOLS_VER.tar.gz
- name: build OR-Tools
if: steps.cached-ortools-restore.outputs.cache-hit != 'true'
shell: bash
run: |
mkdir ${ORTOOLSDIR}
cd or-tools-$ORTOOLS_VER
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEPS=ON -DUSE_COINOR=ON -DUSE_GLPK=ON -DBUILD_EXAMPLES=OFF -DBUILD_SAMPLES=OFF -DBUILD_DOC=OFF -DINSTALL_DOC=OFF -DCMAKE_INSTALL_PREFIX=${ORTOOLSDIR}
cmake --build build --config Debug --target all -j4 -v
cmake --build build --config Debug --target install -v
- name: Always save OR-Tools build
id: cached-ortools-save
if: always() && steps.cached-ortools-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cached-ortools-restore.outputs.cache-primary-key }}
path: ${{env.ORTOOLSDIR}}/
- name: Get cached GTest
uses: actions/cache@v4
id: cachedgtest
with:
path: ${{env.GTEST}}/
key: gtest-ubuntu
- name: Clone Gtest
if: steps.cachedgtest.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
ref: ${{env.GTEST_REF}}
- name: build Gtest
if: steps.cachedgtest.outputs.cache-hit != 'true'
run: |
export
mkdir ${GTEST}/build
cd ${GTEST}/build
cmake -DCMAKE_CXX_FLAGS=-std=c++17 ..
make
- name: Checkout SSC
uses: actions/checkout@v4
with:
path: ssc
- name: Build SSC
shell: bash
run: |
# Downloaded OR-Tools has CoinOR enabled
mkdir $SSCDIR/build
cd $SSCDIR/build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=1 -DSAM_SKIP_TOOLS=1 -DUSE_XPRESS=0 -DUSE_COINOR=1 -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_SYSTEM_PREFIX_PATH=${ORTOOLSDIR} -Dabsl_DIR=${ORTOOLSDIR}\lib\cmake\absl" -Dutf8_range_DIR=${ORTOOLSDIR}\lib\cmake\utf8_range" ..
make -j4
- name: Test
shell: bash
run: |
set -e
${SSCDIR}/build/test/Testd
- name: Coverage
shell: bash
run: |
cd ${SSCDIR}/build
make coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: ${{runner.workspace}}/ssc/ssc/build/coverage.info
github-token: ${{ secrets.GITHUB_TOKEN }}