Add regression tests #15
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 | |
container: | |
image: ubuntu:20.04 | |
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 requirements.txt | |
- name: Download image data | |
run: 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 }} |