Add regression tests #20
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: Regression tests | |
on: | |
pull_request: | |
branches: ['develop'] | |
jobs: | |
compute_seg_masks: | |
name: Compute results | |
runs-on: self-hosted | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: '3.8.5' | |
# | |
# - name: Install dependencies | |
# run: pip install -r requirements.txt | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: 'latest' | |
channels: conda-forge, bioconda | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
auto-update-conda: true | |
auto-activate-base: false | |
activate-environment: superdsm | |
environment-file: superdsm.yml | |
- name: Download image data | |
run: | | |
conda info | |
python --version | |
cd examples | |
python load_data.py | |
- name: Run SuperDSM | |
run: python -m "superdsm.batch" examples --task-dir "U2OS" --task-dir "NIH3T3" --task-dir "BBBC039" --task-dir "GOWT1-1" --task-dir "GOWT1-2" --run | |
- name: Aggregate results | |
run: | | |
rm -rf examples/fibroblast | |
for taskdir in $(cd examples && find . -name 'seg') | |
do | |
mkdir -p "results/$taskdir" | |
mv examples/$taskdir/*.png "results/$taskdir/" | |
done | |
- name: Upload results artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: seg_masks | |
path: results | |
validate_results: | |
name: Validate results | |
runs-on: ubuntu-latest | |
needs: ['compute_seg_masks'] | |
strategy: | |
matrix: | |
taskdir: | |
- U2OS/default | |
- U2OS/default/adapted | |
- U2OS/default/adapted/isbi24 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8.5' | |
- name: Install dependencies | |
run: pip install -r tests/regression/requirements.txt | |
- name: Download results artifact | |
uses: actions/download-artifact@v3 | |
- name: Run tests | |
run: | | |
mkdir actual_csv | |
python tests/regression/test.py results/${{ matrix.taskdir }}/seg actual_csv tests/regression/expected/${{ matrix.taskdir }} |