Skip to content

Commit

Permalink
Added CI actions for testing, docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jun 25, 2024
1 parent 29d8bca commit fc4a739
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/doxygenate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
push:
branches:
- master

name: Build documentation

jobs:
doxygenator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add Pretty CSS
uses: wei/wget@v1
with:
args: -O docs/doxygen-awesome.css https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/main/doxygen-awesome.css
- name: Download tagfile
uses: wei/wget@v1
with:
args: -O docs/tatami.tag https://tatami-inc.github.io/tatami/tatami.tag
- name: Doxygen Action
uses: mattnotmitt/doxygen-action@v1
with:
working-directory: docs/
- name: GH Pages Deployment
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/html
target-folder: docs/
clean: true # Automatically remove deleted files from the deploy branch
62 changes: 62 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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: Configure the build with coverage
if: ${{ matrix.config.cov }}
run: cmake -S . -B build -DCODE_COVERAGE=ON

- name: Configure the build with custom parallelization
if: ${{ ! matrix.config.cov }}
run: cmake -S . -B build

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

- name: Run the tests
run: |
cd build
ctest --rerun-failed --output-on-failure
- name: Generate code coverage
if: ${{ matrix.config.cov }}
run: |
cd build/tests/CMakeFiles/
find -type f -name "*.gcno" -execdir gcov -abcfu {} +
- name: Upload to Codecov
if: ${{ matrix.config.cov }}
uses: codecov/codecov-action@v4
with:
directory: build/tests/CMakeFiles/
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit fc4a739

Please sign in to comment.