Repository navigation
195 lines (188 loc) · 5.88 KB
/
Copy pathpython-app.yaml
File metadata and controls
195 lines (188 loc) · 5.88 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: MONSDA CI
on:
push:
branches: [main, develop]
tags:
- "v*"
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
workflow_dispatch:
inputs:
run_full_pipeline:
description: "Run full pipeline integration test"
required: false
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint (flake8, isort)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install linting tools
run: |
python -m pip install --upgrade pip
python -m pip install flake8 isort
- name: Check import sorting with isort
run: isort --check-only --diff MONSDA/ tests/
continue-on-error: true
- name: Lint with flake8
run: flake8 MONSDA/ tests/ --count --statistics --show-source
continue-on-error: true
tests:
name: Unit tests (pytest)
runs-on: ubuntu-latest
needs: lint
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: monsda-test
environment-file: environment.yml
python-version: 3.12.2
channels: conda-forge,bioconda
allow-softlinks: true
channel-priority: flexible
show-channel-urls: true
use-only-tar-bz2: false
auto-activate-base: false
- name: Install dependencies
run: |
cd ${{ github.workspace }}
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest pytest-cov
- name: Run unit tests with coverage
run: |
cd ${{ github.workspace }}
pytest tests/ -v --cov=MONSDA --cov-report=xml --cov-report=html --cov-fail-under=25
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
build:
name: Build package
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build wheel setuptools versioneer
- name: Sync config versions
run: |
python scripts/update_config_versions.py configs/*.json tests/data/config_*.json
- name: Build distribution
run: |
python -m build
- name: Check build artifacts
run: |
ls -lh dist/
python -m pip install twine
twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
retention-days: 7
full-pipeline:
name: Full pipeline integration test
runs-on: ubuntu-latest
needs: tests
if: >-
(github.event_name == 'workflow_dispatch' && inputs.run_full_pipeline) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'full-pipeline'))
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: monsda-test
environment-file: environment.yml
python-version: 3.12.2
channels: conda-forge,bioconda
allow-softlinks: true
channel-priority: flexible
show-channel-urls: true
use-only-tar-bz2: false
auto-activate-base: false
- name: Build and install MONSDA
run: |
cd ${{ github.workspace }}
python -m pip install --upgrade pip
python -m pip install -e .
- name: Prepare integration test config
run: |
cd ${{ github.workspace }}
python scripts/update_config_versions.py tests/data/config_Test.json
- name: Run full pipeline test
run: |
cd ${{ github.workspace }}/tests
ln -fs data/* .
mkdir -p CONDALIB
monsda -j 6 -c config_Test.json --directory ${PWD} --use-conda --conda-prefix CONDALIB --save
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: full-pipeline-debug-artifacts
path: |
${{ github.workspace }}/tests/LOGS
${{ github.workspace }}/tests/SUBSNAKES
${{ github.workspace }}/tests/FASTQ
${{ github.workspace }}/tests/MAPPED
${{ github.workspace }}/tests/QC
${{ github.workspace }}/tests/COUNTING
${{ github.workspace }}/tests/PEAKS
${{ github.workspace }}/tests/TRACKS
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/project/MONSDA
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/