-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (80 loc) · 2.3 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
blas: "ON"
- os: macos-latest
blas: "ON"
- os: windows-latest
blas: "OFF"
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -yy && sudo apt-get install -yy libopenblas-openmp-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install llvm libomp openblas
echo CC="$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
echo CXX="$(brew --prefix llvm)/bin/clang++" >> $GITHUB_ENV
fi
- name: Build & test
env:
HPCPP_WITH_BLAS: ${{ matrix.blas }}
run: |
mkdir build && cd build
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DHPCPP_WITH_BLAS=$HPCPP_WITH_BLAS ..
cmake --build . --config Release -j 3
ctest
- name: Run benchmark
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./build/bench/Release/bench.exe --benchmark_min_time=0.1
else
./build/bench/bench --benchmark_min_time=0.1
fi
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install gcovr
- name: Build & test
run: |
mkdir build && cd build
cmake -DBUILD_TESTING=ON -DHPCPP_BUILD_BENCHMARKS=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage" ..
cmake --build . -j 3
ctest
- name: Generate coverage report
run: |
gcovr --exclude-throw-branches -r . -f include/ -f src/ --xml -o coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
verbose: true