-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (59 loc) · 2.14 KB
/
run.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
dataset=Siemens_mMR_NEMA_IQ
curl -sfSL -o ${dataset}.zip https://petric.tomography.stfc.ac.uk/data/${dataset}.zip
mkdir -p data; cd data; unzip -u ../${dataset}.zip; cd ..
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
import petric
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)
data = petric.get_data('NeuroLF_Hoffman_Dataset')
assert data.OSEM_image.max() > 0
assert data.reference_image.max() > 0
assert data.FOV_mask.max() > 0
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