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" -not -name "zmq_example" | xargs -I {} -n 1 -t bash -c {}