-
Notifications
You must be signed in to change notification settings - Fork 113
132 lines (113 loc) · 3.67 KB
/
ci.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
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
name: tudatBundleCI
# adapted from:
# https://github.com/jherico/starter-workflows/blob/master/ci/cmake.yml
# and
# https://github.com/onqtam/doctest/blob/master/.github/workflows/main.yml
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# every Monday at 04:00
- cron: '0 4 * * 1'
env:
BUILD_TYPE: Release
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
ubuntu-gcc,
ubuntu-clang,
macOS-gcc,
macOS-clang,
windows-gcc,
# windows-clang,
]
include:
- name: ubuntu-gcc
os: ubuntu-latest
compiler: gcc
- name: ubuntu-clang
os: ubuntu-latest
compiler: clang
- name: macOS-gcc
os: macOS-latest
compiler: gcc
- name: macOS-clang
os: macOS-latest
compiler: clang
- name: windows-gcc
os: windows-latest
compiler: gcc
# - name: windows-clang
# os: windows-latest
# compiler: clang
steps:
- uses: actions/checkout@v1
# - name: Install clang on Windows
# This step leads to the error "C POSIX libraries not found on system.
# Please (re)install development environment." from
# external/CMake/add_boost.cmake
# if: ( contains(matrix.os, 'windows') &&
# contains(matrix.compiler, 'clang') )
# shell: powershell
# run: |
# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# scoop install llvm --global
# # Scoop modifies the PATH so we make the modified PATH global.
# echo "::set-env name=PATH::$env:PATH"
- name: Set Compiler Environment
shell: bash
run: |
if [ "${{ matrix.compiler }}" = "clang" ]; then
echo "::set-env name=CC::clang"
echo "::set-env name=CXX::clang++"
else
echo "::set-env name=CC::gcc"
echo "::set-env name=CXX::g++"
fi
- name: Clone Submodules
shell: bash
run: git submodule update --init --recursive
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake linux
if: contains(matrix.os, 'ubuntu')
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -B . -S ../tudatBundle
- name: Configure CMake macos
if: contains(matrix.os, 'macos')
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
# see https://stackoverflow.com/questions/24380456/
# how-can-i-make-cmake-use-gcc-instead-of-clang-on-mac-os-x/24380618
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -B . -S ../tudatBundle -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX
- name: Configure CMake windows
if: contains(matrix.os, 'windows')
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
# See https://github.com/actions/virtual-environments/issues/10
# and https://stackoverflow.com/questions/3016448/
# how-can-i-get-cmake-to-find-my-alternative-boost-installation
cmake -G "MinGW Makefiles" -DBoost_NO_BOOST_CMAKE=TRUE -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -B . -S ../tudatBundle
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --target all --config $BUILD_TYPE
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE