-
Notifications
You must be signed in to change notification settings - Fork 218
78 lines (70 loc) · 2.3 KB
/
build.yaml
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
name: Build and Test
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
name: Build and test on ${{ matrix.os }} ${{ matrix.compiler }}
strategy:
matrix:
include:
- os: windows-2019
cmake_generator: "-G \"Visual Studio 16 2019\" -A x64"
- os: windows-2019
cmake_generator: "-G \"Visual Studio 16 2019\" -A Win32"
- os: macos-latest
privledges: "sudo"
- os: ubuntu-20.04
privledges: "sudo"
- os: ubuntu-20.04
privledges: "sudo"
compiler: "clang"
analyzers: "cppcheck"
scan: "scan-build --status-bugs"
mkdoc: "-DBUILD_DOC=ON -DSPHINX_ARGS=-WT"
- os: macos-latest
privledges: "sudo"
arch: arm64
steps:
- uses: actions/checkout@v2
- name: Install clang toolchain
if: ${{ matrix.compiler == 'clang' }}
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install clang clang-tools
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
- name: Run cppcheck
shell: bash
if: ${{ matrix.analyzer == 'cppcheck' }}
run: |
cppcheck
--enable=style,portability,performance,warning
--library=posix
--library=cppcheck/segyio.cfg
--suppressions-list=cppcheck/suppressions.txt
--inline-suppr
--project=compile_commands.json
--error-exitcode=1
- name: Configure
shell: bash
run: |
${{ matrix.scan }} cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_PYTHON=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_NAME_DIR=/usr/local/lib \
${{ matrix.mkdoc }} \
${{ matrix.cmake_generator }} \
- name: Build and Install
shell: bash
run: |
${{ matrix.privledges }} cmake \
--build build \
--config Release \
--target install \
- name: Test
shell: bash
run: |
cd build
ctest -C Release --output-on-failure