Testing infra #7
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: project tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
push: | |
branches: | |
- main | |
jobs: | |
projectchanges: | |
runs-on: ubuntu-latest | |
outputs: | |
projects: ${{ steps.filter.outputs.projectchanges }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: .github/project-filters.yaml | |
if: github.event.pull_request.draft == false | |
# second job takes those outputs and runs | |
# unit tests on these libs and projects | |
tests: | |
runs-on: ubuntu-latest | |
needs: projectchanges | |
strategy: | |
fail-fast: false # is this desired behavior here? | |
matrix: | |
project: ${{ fromJSON(needs.projectchanges.outputs.projects) }} | |
exclude: | |
# don't run non-existent .github/workflow tests, | |
# and exclude projects, whose tests are run in | |
# a different CI script | |
- project: 'workflow' | |
permissions: | |
packages: read | |
container: | |
image: quay.io/singularity/singularity:v3.8.1 | |
options: --privileged | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build Apptainer image | |
run: | | |
cd projects/${{ matrix.project }} | |
apptainer build --fakeroot ${matrix.project}.sif apptainer.def | |
- name: Run tests in Apptainer container | |
run: | | |
cd projects/${{ matrix.project }} | |
apptainer exec --fakeroot ${matrix.project}.sif poetry run pytest |