Skip to content

add test scripts

add test scripts #88

Workflow file for this run

name: run
on:
push:
branches: ['**']
tags: ['**']
paths-ignore: ['.gitignore', 'LICENSE*', 'LICENCE*', 'README.md', 'SIRF_data_preparation/*']
jobs:
check:
runs-on: ubuntu-latest
container:
image: ghcr.io/synerbi/sirf:edge
options: --user root # https://github.com/actions/checkout/issues/956
steps:
- uses: actions/checkout@v4
- name: Install dependencies
shell: bash -el {0}
run: |
source /opt/SIRF-SuperBuild/INSTALL/bin/env_sirf.sh
pip install git+https://github.com/TomographicImaging/Hackathon-000-Stochastic-QualityMetrics
if test -f apt.txt; then
sudo apt-get update
xargs -a apt.txt sudo apt-get install -y
fi
if test -f environment.yml; then
sed -i '/^name:.*/d' environment.yml
conda env update -n base
fi
if test -f requirements.txt; then
pip install -r requirements.txt
fi
conda list
- name: Test imports
shell: bash -el {0}
run: |
source /opt/SIRF-SuperBuild/INSTALL/bin/env_sirf.sh
curl -fsSL https://raw.githubusercontent.com/SyneRBI/PETRIC/main/petric.py > petric.py
test -f main.py || ln -s main_ISTA.py main.py
python <<EOF
from main import Submission, submission_callbacks
from cil.optimisation.algorithms import Algorithm
assert issubclass(Submission, Algorithm)
assert isinstance(submission_callbacks, list)
assert all(callable(callback) for callback in submission_callbacks)
EOF
full:
if: startsWith(github.ref, 'refs/tags')
runs-on: [self-hosted, docker, cuda]
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0, submodules: recursive}
- run: petric