Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ padd
struc
TE
warmup
ALS
86 changes: 86 additions & 0 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: test

# File: test.yaml
# Author: David Kügler
# Created on: 2025-09-08
# Functionality: This workflow runs unit tests defined in tests/image.

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true

on:
pull_request:
workflow_dispatch:

permissions:
actions: read
attestations: read
checks: read
contents: read
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: write
repository-projects: read
security-events: read
statuses: read

jobs:
image-test:
name: 'Run FastSurfer unit tests from test/image'
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
matrix:
tests: ["image"]
pytest-flags: [""]

steps:
- uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
cache: 'pip' # caching pip dependencies
- name: Install dependencies
shell: bash
# uses the same python environment as quicktest
run: |
echo "::group::Create python environment"
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off .[quicktest]
echo "::endgroup::"
# run pytest checks for data consistency/quality
- name: Run pytest
env:
PYTHON_PATH: .
FASTSURFER_HOME: ${{ github.workspace }}
shell: bash
continue-on-error: true # pytest only exits with code 0, if all tests pass
run: |
echo "::group::Run tests"
flags=("--junit-xml=/tmp/fastsurfer-unittest-${{ matrix.tests }}.junit.xml")
if [[ "$ACTION_RUNNER_DEBUG" == "true" ]]
then
flags+=(-vv --log_cli_level=DEBUG)
fi
python -m pytest "${flags[@]}" ${{ matrix.pytest-flags }} test/${{ matrix.tests }}
echo "::endgroup::"
- name: Upload the JUnit XML file as an artifact
uses: actions/upload-artifact@v4
with:
name: fastsurfer-${{ github.sha }}-${{ matrix.tests }}-junit
path: /tmp/fastsurfer-unittest-${{ matrix.tests }}.junit.xml
- name: Annotate the results into the check
uses: mikepenz/action-junit-report@v5
with:
report_paths: /tmp/fastsurfer-unittest-${{ matrix.tests }}.junit.xml
check_name: Annotate the test results as checks
fail_on_failure: 'true'
fail_on_parse_error: 'true'
annotate_only: 'true' # here, we only add the annotations, the fail-state cannot be set here because the
# github token cannot have the required permissions in PRs from forks
Loading
Loading