Bump actions/setup-python from 4 to 5 #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |