-
-
Notifications
You must be signed in to change notification settings - Fork 20
87 lines (73 loc) · 2.77 KB
/
python.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: python
on:
push:
pull_request:
branches:
- main
workflow_call:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
Python-Collect-Data-and-Test:
runs-on: ${{ matrix.os }}
env:
ECAT_TEST_FOLDER: "cimbi36"
REAL_TEST_ECAT_PATH: cimbi36/Gris_102_19_2skan-2019.04.30.13.04.41_em_3d.v
SMALLER_ECAT_PATH: ${{ github.workspace }}/ecat_validation/ECAT7_multiframe.v.gz
TEST_ECAT_PATH: ${{ github.workspace }}/ecat_validation/ECAT7_multiframe.v
OUTPUT_NIFTI_PATH: ${{ github.workspace}}/pypet2bids/tests/ECAT7_multiframe.nii
READ_ECAT_SAVE_AS_MATLAB: ${{ github.workspace }}/pypet2bids/tests/ECAT7_multiframe.mat
NIBABEL_READ_ECAT_SAVE_AS_MATLAB: ${{ github.workspace }}/pypet2bids/tests/ECAT7_multiframe.nibabel.mat
MATLAB_CODE_PATH: ${{ github.workspace }}/matlab/
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
python: ['3.8', '3.9', '3.10']
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Cache ECAT
id: cache-ecat
uses: actions/cache@v2
with:
path: cimbi36
key: ${{ runner.os }}-ecats
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
cd pypet2bids
pip3 install .
- name: Install gdown and collect Ecat from Google Drive
if: steps.cache-ecat.outputs.cache-hit != 'true'
run: "python3 -m pip install gdown && gdown ${{ secrets.CIMBI_ECAT_ON_GOOGLE_DRIVE }} -O ecat_test"
- name: Decompress dataset
if: steps.cache-ecat.outputs.cache-hit != 'true'
run: "tar xvzf ecat_test && rm ecat_test"
- name: Test CLI --help
run: |
cd pypet2bids/
python3 -m pypet2bids.ecat_cli --help
- name: Test CLI Ecat Dump
run: |
cd pypet2bids/
python3 -m pypet2bids.ecat_cli ../${{ env.REAL_TEST_ECAT_PATH }} --dump
# the larger real data file uses too much ram for the github runner, we use the small file for
# heavy io operations instead
- name: Unzip Test File(s)
run: |
gzip -d ${{ env.SMALLER_ECAT_PATH }}
- name: Test ecatread
run: "cd pypet2bids/ && python3 -m tests.test_ecatread"
- name: Run All Other Python Tests w/ Pytest
run: |
cd pypet2bids
pytest -k 'not write_pixel_data' -k 'not test_convert_pmod_to_blood' tests/