Skip to content

Fix tests

Fix tests #80

Workflow file for this run

name: Tests-Mac
on:
push:
branches:
- main
pull_request: {}
schedule:
- cron: '0 23 * * SUN-THU'
workflow_dispatch:
jobs:
tests:
runs-on: macos-latest
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 Debug
run: |
cmake -B build_debug -S . -DARGO_TESTS_ENABLE=true -GNinja -DCMAKE_BUILD_TYPE=Debug -DARGO_CLANG_TIDY_ENABLE=ON
cmake --build build_debug
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: Build Release
run: |
cmake -B build_release -S . -DARGO_TESTS_ENABLE=true -GNinja -DCMAKE_BUILD_TYPE=Release
cmake --build build_release
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 Release
run: |
cmake --build build_release --target test
- name: Test Debug with codecov
run: |
LLVM_PROFILE_FILE=./build_debug/test-argo.profraw ./build_debug/test-argo
/usr/local/opt/llvm/bin/llvm-profdata merge -sparse ./build_debug/test-argo.profraw -o ./build_debug/coverage.profdata
/usr/local/opt/llvm/bin/llvm-cov show ./build_debug/test-argo -instr-profile=./build_debug/coverage.profdata -ignore-filename-regex="tests*" -ignore-filename-regex="Argo/ArgoExceptions.cc" > ./build_debug/coverage.txt
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./build_debug/coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}