Run Tests #17
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: Run Tests | |
on: | |
# push: | |
# branches: [ "dev" ] | |
# pull_request: | |
# branches: [ "dev" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ci-gpu | |
steps: | |
# Checkout repo | |
- name: checkout | |
uses: actions/checkout@v4 | |
# Prepare job: Set up Python, Go, Singularity | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '^1.13.1' # The Go version to download (if necessary) and use. | |
- name: Set up Singularity | |
uses: eWaterCycle/setup-singularity@v7 | |
with: | |
singularity-version: 3.8.3 | |
# Build Docker Image and convert it to Singularity | |
- name: Build Docker Image and conver to Singularity | |
run: | | |
cd $RUNNER_SINGULARITY_IMGS | |
FILE="fastsurfer-gpu.sif" | |
if [ ! -f "$FILE" ]; then | |
# If the file does not exist, build the file | |
echo "SIF File does not exist. Building file." | |
PYTHONPATH=$PYTHONPATH | |
cd $PYTHONPATH | |
python3 Docker/build.py --device cuda --dry_run --tag fastsurfer_gpu:cuda | bash | |
cd $RUNNER_SINGULARITY_IMGS | |
singularity build --force fastsurfer-gpu.sif docker-daemon://fastsurfer_gpu:cuda | |
else | |
echo "File already exists" | |
cd $PYTHONPATH | |
fi | |
# Test file existence | |
test-file-existence: | |
runs-on: ci-gpu | |
needs: build | |
steps: | |
- name: Test File Existence | |
run: | | |
singularity exec --bind $GITHUB_WORKSPACE:/fastsurfer-dev --env FASTSURFER_HOME=/fastsurfer-dev $RUNNER_SINGULARITY_IMGS/fastsurfer-gpu.sif python3 test/test_file_existence.py $RUNNER_FS_OUTPUT_FILES | |
# Test for errors in log files | |
test-error-messages: | |
runs-on: ci-gpu | |
needs: test-file-existence | |
steps: | |
- name: Test Log Files For Error Messages | |
run: | | |
singularity exec --bind $GITHUB_WORKSPACE:/fastsurfer-dev --env FASTSURFER_HOME=/fastsurfer-dev fastsurfer-gpu.sif python3 test/test_file_existence.py $RUNNER_FS_OUTPUT_FILES |