-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (129 loc) · 4.22 KB
/
build.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Build
on: [push, pull_request]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
HOMEBREW_NO_INSTALL_CLEANUP: 1
MACOSX_DEPLOYMENT_TARGET: 10.15
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-20.04
build_type: Release
clang_version: 15
cmake_flags: ""
cmake_targets: all
- name: macOS
os: macos-13
build_type: Release
clang_version: ""
cmake_flags: '-D CMAKE_OSX_ARCHITECTURES="arm64;x86_64"'
cmake_targets: all
- name: Windows
os: windows-latest
build_type: Release
clang_version: latest
cmake_flags: '-D CMAKE_CXX_FLAGS="-march=native"'
cmake_targets: all
- name: Coverage Native
os: ubuntu-22.04
build_type: Debug
clang_version: ""
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=native"'
cmake_targets: neo_fft_tests
- name: Coverage SSE41
os: ubuntu-22.04
build_type: Debug
clang_version: ""
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -march=nehalem"'
cmake_targets: neo_fft_tests
- name: Coverage SSE2
os: ubuntu-22.04
build_type: Debug
clang_version: ""
cmake_flags: '-D CMAKE_CXX_FLAGS="--coverage -msse2"'
cmake_targets: neo_fft_tests
- name: Sanitizers
os: ubuntu-20.04
build_type: Debug
clang_version: 15
cmake_flags: '-D CMAKE_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -march=ivybridge"'
cmake_targets: neo_fft_tests
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
lfs: true
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: >
sudo apt update &&
sudo apt install
libcurl4-openssl-dev
libasound2-dev
libx11-dev
libxinerama-dev
libxext-dev
libfreetype6-dev
libwebkit2gtk-4.0-dev
libglu1-mesa-dev
xvfb
ninja-build
gcovr
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install ninja osxutils
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: bash
run: choco install ninja ccache
- name: Install clang
if: runner.os != 'macOS' && !contains(matrix.name, 'Coverage')
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.clang_version }}
- name: Install ccache
uses: hendrikmuhs/ccache-action@main
with:
key: perceptual-convolution-build-${{ matrix.name }}
- name: Print native arch flags (GCC)
if: contains(matrix.name, 'Coverage')
shell: bash
run: gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
- name: CMake configure
shell: bash
run: cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_flags }}
- name: CMake build
shell: bash
run: cmake --build build --target ${{ matrix.cmake_targets }}
- name: CTest
shell: bash
run: ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure
- name: Coverage report
if: contains(matrix.name, 'Coverage')
shell: bash
run: >
gcovr
--xml-pretty
-e ".*_test\.cpp"
--exclude-unreachable-branches
--exclude-throw-branches
-r src/lib
-s build
-o build/coverage.xml
- name: Upload coverage report
uses: codecov/codecov-action@v3
if: contains(matrix.name, 'Coverage')
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
fail_ci_if_error: true