Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github ci #40

Merged
merged 7 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/common-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and run tests
on:
workflow_call:
inputs:
use-system-libraries: # the variable you can use in place of a matrix
required: true
type: string
default: OFF
build-type:
required: true
type: string
default: Debug
use-python-bindings:
required: true
type: string
default: OFF

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
if: ${{ contains(inputs.use-system-libraries, 'ON')}}
with:
micromamba-version: '1.5.6-0' # any version from https://github.com/mamba-org/micromamba-releases
environment-file: aare-environment.yml
init-shell: bash
cache-environment: true
post-cleanup: 'all'
- name: build
shell: bash -el {0}
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{inputs.build-type}} -DAARE_PYTHON_BINDINGS=${{inputs.use-python-bindings}} -DAARE_SYSTEM_LIBRARIES=${{inputs.use-system-libraries}}
cmake --build . -j
- name: run tests
run: |
cd build/
./run_tests
- name: run examples
# find all examples in build/examples and run them
run: |
pwd
export PROJECT_ROOT_DIR="."
ls build/examples/*_example
find build/examples -name "*_example" | xargs -I {} -n 1 -t bash -c {}



28 changes: 28 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# config file to run multiple jobs in parallel with matrix strategy
name: Config Workflow

on:
push:

jobs:
build-and-test:
strategy:
# super important if you want to see all results, even if one fails
# fail-fast is true by default
fail-fast: false
matrix:
use-system-libraries: ["OFF","ON"]
build-type: ["Debug","Release"]
use-python-bindings: ["OFF","ON"]
# exclude:
# # excludes combinations that are not supported
# - use-python-bindings: "ON"
# use-sanitizers: "ON"

uses: ./.github/workflows/common-workflow.yml # calls the one above
with:
use-system-libraries: ${{ matrix.use-system-libraries }}
build-type: ${{ matrix.build-type }}
use-python-bindings: ${{ matrix.use-python-bindings }}
secrets: inherit

9 changes: 9 additions & 0 deletions aare-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: aare
channels:
- conda-forge
- defaults
dependencies:
- fmt
- pybind11
- nlohmann_json
- catch2
Loading