-
Notifications
You must be signed in to change notification settings - Fork 14
113 lines (91 loc) · 3.85 KB
/
build_linux.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
# Copyright (c) 2023, DyssolTEC. All rights reserved. This file is part of Dyssol. See LICENSE file for license information.
# A workflow for testing on Windows
name: Linux
on: [push]
jobs:
build:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: linux-gcc
os: linux
cxx: g++
cxxflags: ""
linker_flags: ""
build_type: Release
- name: linux-gcc-san
os: linux
cxx: g++
cxxflags: "-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=leak"
linker_flags: "-fno-omit-frame-pointer -fsanitize=address -fsanitize=leak"
build_type: RelWithDebInfo
- name: linux-clang
os: linux
cxx: clang++
cxxflags: ""
linker_flags: ""
build_type: Release
- name: linux-clang-san
os: linux
cxx: clang++
cxxflags: "-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=leak"
linker_flags: "-fno-omit-frame-pointer -fsanitize=address -fsanitize=leak"
build_type: RelWithDebInfo
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: sudo add-apt-repository ppa:gladky-anton/sundials && sudo apt-get install build-essential libsundials-dev libhdf5-serial-dev libqt5opengl5-dev libgraphviz-dev
- name: Create build environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Create install environment
run: cmake -E make_directory ${{github.workspace}}/install
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.linker_flags }}" -DCMAKE_SHARED_LINKER_FLAGS="${{ matrix.linker_flags }}" -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DBUILD_DOCS=NO
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --parallel $(nproc)
- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
run: make install
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: CTEST_OUTPUT_ON_FAILURE=1 make test ARGS=-j$(nproc)
docs:
name: Docs
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Install build doc dependencies
run: sudo apt-get install doxygen graphviz python3-sphinx python3-sphinx-rtd-theme python3-breathe texlive-latex-extra
- name: Create build environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Create install environment
run: cmake -E make_directory ${{github.workspace}}/install
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DBUILD_BINARIES=NO -DBUILD_TESTS=NO
- name: Build docs
working-directory: ${{github.workspace}}/build
shell: bash
run: make doc
- name: Install docs
if: ${{ github.ref == 'refs/heads/master' }}
working-directory: ${{github.workspace}}/build
shell: bash
run: make install
- name: Deploy docs
if: ${{ github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: ${{github.workspace}}/install/share/Dyssol/docs/sphinx/html # The folder the action should deploy.
single-commit: true