Skip to content

Tests-Mac

Tests-Mac #121

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
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 }}