forked from naturalis/barcode_validator
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (91 loc) · 2.98 KB
/
python-package.yml
File metadata and controls
106 lines (91 loc) · 2.98 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
name: Python package
on:
push:
branches: [ "main", "refactor", "schema", "batched", "in-place-record-trimming" ]
tags:
- 'v*' # Trigger on any tag that starts with 'v'
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for setuptools_scm to determine the version
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda
channel-priority: strict
activate-environment: barcode_validator
environment-file: environment.yml
auto-activate-base: false
- name: Install additional test dependencies
shell: bash -l {0}
run: |
conda activate barcode_validator
pip install pytest pytest-cov flake8
pip install -e .
- name: Test environment
shell: bash -l {0}
run: |
conda activate barcode_validator
conda list
which python
which blastn
which hmmalign
- name: Lint with flake8
shell: bash -l {0}
run: |
conda activate barcode_validator
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
shell: bash -l {0}
env:
GALAXY_DOMAIN: ${{ secrets.GALAXY_DOMAIN }}
GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}
run: |
conda activate barcode_validator
pytest --cov=barcode_validator --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
publish:
needs: build # Only run if the build job passes
if: startsWith(github.ref, 'refs/tags/v') # Only run on tag pushes starting with 'v'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for setuptools_scm to determine the version
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda
channel-priority: strict
activate-environment: barcode_validator
environment-file: environment.yml
auto-activate-base: false
- name: Install build dependencies
shell: bash -l {0}
run: |
conda activate barcode_validator
pip install build twine
- name: Build package
shell: bash -l {0}
run: |
conda activate barcode_validator
python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}