generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 18
102 lines (91 loc) · 2.93 KB
/
google-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
95
96
97
98
99
100
101
102
name: GoogleTest
on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- '.github/workflows/google-test.yml'
- 'ExtLibraries/**'
- 'CMakeLists.txt'
- 'common.cmake'
- 'src/**'
jobs:
build_s2e_test_linux:
name: Build on Linux with test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: ['gcc-11 g++-11', 'clang clang++']
steps:
- uses: actions/checkout@v4
- name: checkout the submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: set compiler
id: compiler
run: |
COMPILER="${{ matrix.compiler }}"
read -r -a COMPILER <<< "$COMPILER"
echo "CC=${COMPILER[0]}" >> "$GITHUB_OUTPUT"
echo "CXX=${COMPILER[1]}" >> "$GITHUB_OUTPUT"
- name: install deps
run: |
# FIXME: temporary install gcc-11 in ubuntu:focal
if [[ "${{ steps.compiler.outputs.CC }}" =~ "gcc-11" ]]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
fi
sudo apt-get update
if [[ "${{ steps.compiler.outputs.CC }}" =~ "gcc" ]]; then
sudo apt-get install -y ${{ steps.compiler.outputs.CC }}-multilib \
${{ steps.compiler.outputs.CXX }}-multilib
else
sudo apt-get install -y gcc-multilib g++-multilib
fi
- name: show tools version
run: |
cmake --version
${{ steps.compiler.outputs.CC }} --version
${{ steps.compiler.outputs.CXX }} --version
- name: cache extlib
id: cache-extlib
uses: actions/cache@v4
with:
key: extlib-${{ runner.os }}-${{ hashFiles('./ExtLibraries/**') }}}
path: ExtLibraries
- name: build extlib
if: steps.cache-extlib.outputs.cache-hit != 'true'
working-directory: ./ExtLibraries
run: |
cmake . -DEXT_LIB_DIR="$(pwd)" -DBUILD_64BIT=ON
cmake --build .
- name: install extlib
if: steps.cache-extlib.outputs.cache-hit != 'true'
working-directory: ./ExtLibraries
run: |
cmake --install .
- name: check extlib
working-directory: ./ExtLibraries
run: |
ls cspice
ls cspice/cspice_unix*
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.a
ls nrlmsise00/src
- name: build
env:
CC: ${{ steps.compiler.outputs.CC }}
CXX: ${{ steps.compiler.outputs.CXX }}
run: |
cmake . -DEXT_LIB_DIR=./ExtLibraries -DBUILD_64BIT=ON -DGOOGLE_TEST=ON -DCORE_DIR_FROM_EXE=../s2e-core
cmake --build .
- name: run test
run: ./S2E_TEST