-
Notifications
You must be signed in to change notification settings - Fork 12
96 lines (81 loc) · 3.62 KB
/
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
name: Linux
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -e -l {0}
jobs:
build:
runs-on: ubuntu-22.04
name: ${{ matrix.sys.compiler }} / ${{ matrix.sys.version }} / ${{ matrix.sys.stdlib }} / ${{ matrix.config.name }} / date-polyfill ${{ matrix.sys.date-polyfill}}
strategy:
fail-fast: false
matrix:
sys:
- {compiler: clang, version: '16', config-flags: '', stdlib: 'libstdc++-12', date-polyfill: 'ON' }
# - {compiler: clang, version: '16', config-flags: '-DCMAKE_CXX_FLAGS=-stdlib=libc++', stdlib: 'libc++-17', date-polyfill: 'ON' }
- {compiler: clang, version: '17', config-flags: '', stdlib: 'libstdc++-12', date-polyfill: 'ON' }
# - {compiler: clang, version: '17', config-flags: '-DCMAKE_CXX_FLAGS=-stdlib=libc++', stdlib: 'libc++-17', date-polyfill: 'ON' }
- {compiler: gcc, version: '12', config-flags: '', date-polyfill: 'ON' }
- {compiler: gcc, version: '13', config-flags: '', date-polyfill: 'ON' }
- {compiler: gcc, version: '13', config-flags: '', date-polyfill: 'OFF' }
config:
- { name: Debug }
- { name: Release }
steps:
- name: Install GCC
if: matrix.sys.compiler == 'gcc'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{matrix.sys.version}}
platform: x64
- name: Install LLVM and Clang
if: matrix.sys.compiler == 'clang'
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{matrix.sys.version}}
arch: x64
- name: Install the specified standard library for clang
if: matrix.sys.compiler == 'clang'
run: sudo apt install ${{matrix.sys.stdlib}}-dev -y
- name: Checkout code
uses: actions/checkout@v4
- name: Set conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-name: myenv
environment-file: environment-dev.yml
init-shell: bash
cache-downloads: true
- name: Configure using CMake
run: cmake -G Ninja -Bbuild ${{matrix.sys.config-flags}} -DCMAKE_BUILD_TYPE:STRING=${{matrix.config.name}} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DUSE_DATE_POLYFILL=${{matrix.sys.date-polyfill}} -DBUILD_TESTS=ON -DUSE_SANITIZER="address;undefined;leak"
- name: Install
working-directory: build
run: cmake --install . --config ${{matrix.config.name}}
- name: Build
working-directory: build
run: cmake --build . --config ${{matrix.config.name}} --target test_sparrow_lib --parallel 8
- name: Run tests
working-directory: build
run: cmake --build . --config ${{matrix.config.name}} --target run_tests_with_junit_report
env:
ASAN_OPTIONS: log_path=${{github.workspace}}/asan.log:alloc_dealloc_mismatch=0
UBSAN_OPTIONS: log_path=${{github.workspace}}/ubsan.log:print_stacktrace=1:halt_on_error=0:handle_abort=0:exitcode=0
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test_sparrow_lib_report_Linux_${{ matrix.sys.compiler }}_${{ matrix.sys.version }}_${{ matrix.sys.stdlib }}_${{ matrix.config.name }}_date-polyfill_${{ matrix.sys.date-polyfill}}
path: '**/test_sparrow_lib_report.xml'
- name: Upload ASAN log
if: always()
uses: actions/upload-artifact@v2
with:
name: asan-log-${{ matrix.sys.compiler }}-${{ matrix.sys.version }}-${{ matrix.config.name }}-${{ matrix.sys.date-polyfill }}
path: ${{github.workspace}}/asan.log