-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 2.08 KB
/
test-mac.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
name: Tests-Mac
on:
push:
branches:
- main
pull_request: {}
schedule:
- cron: '0 23 * * SUN-THU'
workflow_dispatch:
jobs:
tests:
runs-on: macos-latest
strategy:
matrix:
build_type: [Release, Debug]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Upgrade homebrew
run: brew update
continue-on-error: true
- name: Install llvm
run: brew install llvm
continue-on-error: true
- name: Install cmake
run: brew install cmake
continue-on-error: true
- name: Install ninja
run: brew install ninja
continue-on-error: true
- name: Add LLVM Path
run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
- name: Build ${{ matrix.build_type }}
run: |
cmake -B build -S . -DARGO_TESTS_ENABLE=true -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build
env:
CC: /usr/local/opt/llvm/bin/clang
CXX: /usr/local/opt/llvm/bin/clang++
LDFLAGS: -L/usr/local/opt/llvm/lib -L/usr/local/opt/llvm/lib/c++ -Wl,-rpath,/usr/local/opt/llvm/lib/c++
CPPFLAGS: -I/usr/local/opt/llvm/include
- name: Test ${{ matrix.build_type }}
if: matrix.build_type == 'Release'
run: |
cmake --build build --target test
- name: Test Debug with codecov
if: matrix.build_type == 'Debug'
run: |
LLVM_PROFILE_FILE=./build/test-argo.profraw ./build/test-argo
/usr/local/opt/llvm/bin/llvm-profdata merge -sparse ./build/test-argo.profraw -o ./build/coverage.profdata
/usr/local/opt/llvm/bin/llvm-cov show ./build/test-argo -instr-profile=./build/coverage.profdata -ignore-filename-regex="tests*" -ignore-filename-regex="Argo/ArgoExceptions.cc" > ./build/coverage.txt
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
if: matrix.build_type == 'Debug'
with:
files: ./build/coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}