Skip to content

Commit

Permalink
Added a CI action for building and checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jul 10, 2024
1 parent 81d3fa2 commit c728d9e
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
push:
branches:
- master
pull_request:

name: Run unit tests

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest GCC, coverage enabled",
os: ubuntu-latest,
cov: true
}
- {
name: "macOS Latest Clang",
os: macos-latest,
cov: false
}

steps:
- uses: actions/checkout@v4

- name: Get latest CMake
uses: lukka/get-cmake@latest

- name: Install igraph on Mac
if: ${{ matrix.config.os == 'macos-latest' }}
run: |
brew install igraph
- name: Install igraph on Ubuntu
if: ${{ matrix.config.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install libigraph-dev
- name: Configure the build
if: ${{ matrix.config.cov == false }}
run: cmake -S . -B build

- name: Configure the build with coverage
if: ${{ matrix.config.cov == true }}
run: cmake -S . -B build -DCODE_COVERAGE=ON

- name: Run the build
run: cmake --build build

- name: Run the tests
run: |
cd build
ctest
- name: Upload to Codecov
if: ${{ matrix.config.cov == true }}
uses: codecov/codecov-action@v4
with:
directory: build/tests/CMakeFiles/libtest.dir/src/
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit c728d9e

Please sign in to comment.