forked from Reed-CompBio/spras
-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (166 loc) · 5.88 KB
/
test-spras.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Test SPRAS
on: [push, pull_request]
jobs:
# Installs the conda environment but does not run tests because the tests require Linux Docker images
conda-only:
name: Test conda environment
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: spras
environment-file: environment.yml
auto-activate-base: false
miniconda-version: 'latest'
# Log conda environment contents
- name: Log conda environment
shell: bash --login {0}
run: conda list
# Runs the test code and Snakemake workflow in the conda environment
test:
name: Run test cases and workflow
# The Docker images will be pulled in both the docker job and this test job
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: spras
environment-file: environment.yml
auto-activate-base: false
miniconda-version: 'latest'
# Log conda environment contents
- name: Log conda environment
shell: bash --login {0}
run: conda list
# Formerly used Singularity instead of Apptainer (see https://github.com/eWaterCycle/setup-singularity/issues/6)
- name: Install Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
# Choose version from https://github.com/apptainer/apptainer/releases
apptainer-version: 1.2.2
- name: Run tests
shell: bash --login {0}
# Verbose output and disable stdout and stderr capturing
run: pytest -vs
- name: Run Snakemake workflow
shell: bash --login {0}
run: snakemake --cores 2 --configfile config/config.yaml --show-failed-logs
# Builds the Docker images
docker:
name: Build Docker images
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Pull from Docker Hub to use the cache
# https://medium.com/mobileforgood/coding-tips-patterns-for-continuous-integration-with-docker-on-travis-ci-9cedb8348a62
# https://github.com/docker/build-push-action/issues/7
- name: Pull Docker images
run: |
docker pull reedcompbio/omics-integrator-1:latest
docker pull reedcompbio/omics-integrator-2:v2
docker pull reedcompbio/pathlinker:latest
docker pull reedcompbio/meo:latest
docker pull reedcompbio/mincostflow:latest
docker pull reedcompbio/allpairs:latest
docker pull reedcompbio/domino:latest
- name: Build Omics Integrator 1 Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/OmicsIntegrator1/.
dockerfile: docker-wrappers/OmicsIntegrator1/Dockerfile
repository: reedcompbio/omics-integrator-1
tags: latest
cache_froms: reedcompbio/omics-integrator-1:latest
push: false
- name: Build Omics Integrator 2 Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/OmicsIntegrator2/.
dockerfile: docker-wrappers/OmicsIntegrator2/Dockerfile
repository: reedcompbio/omics-integrator-2
tags: v2
cache_froms: reedcompbio/omics-integrator-2:v2
push: false
- name: Build PathLinker Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/PathLinker/.
dockerfile: docker-wrappers/PathLinker/Dockerfile
repository: reedcompbio/pathlinker
tags: latest
cache_froms: reedcompbio/pathlinker:latest
push: false
- name: Build Maximum Edge Orientation Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/MEO/.
dockerfile: docker-wrappers/MEO/Dockerfile
repository: reedcompbio/meo
tags: latest
cache_froms: reedcompbio/meo:latest
push: false
- name: Build MinCostFlow Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/MinCostFlow/.
dockerfile: docker-wrappers/MinCostFlow/Dockerfile
repository: reedcompbio/mincostflow
tags: latest
cache_froms: reedcompbio/mincostflow:latest
push: false
- name: Build All Pairs Shortest Paths Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/AllPairs/.
dockerfile: docker-wrappers/AllPairs/Dockerfile
repository: reedcompbio/allpairs
tags: latest
cache_froms: reedcompbio/allpairs:latest
push: false
- name: Build DOMINO Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/DOMINO/.
dockerfile: docker-wrappers/DOMINO/Dockerfile
repository: reedcompbio/domino
tags: latest
cache_froms: reedcompbio/domino:latest
push: false
- name: Build Cytoscape Docker image
uses: docker/build-push-action@v1
with:
path: docker-wrappers/Cytoscape/.
dockerfile: docker-wrappers/Cytoscape/Dockerfile
repository: reedcompbio/py4cytoscape
tags: v3
cache_froms: reedcompbio/py4cytoscape:v3
push: false
# Run pre-commit checks on source files
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8' # Match this to the version specified in environment.yml
- name: Run pre-commit checks
uses: pre-commit/[email protected]