-
Notifications
You must be signed in to change notification settings - Fork 46
150 lines (133 loc) · 3.91 KB
/
deploy.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
# This workflow will upload a Python Package using the PyPi action workflow
name: Upload Python Package
on:
release:
types: [published]
env:
VERMOUTH_TEST_DSSP: mkdssp
SKIP_GENERATE_AUTHORS: 1
SKIP_WRITE_GIT_CHANGELOG: 1
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
py_version: ["3.9", "3.10", "3.11", "3.12"]
include:
- py_version: "3.9"
WITH_CODECOV: true
- py_version: "3.10"
WITH_CODECOV: true
- py_version: "3.11"
WITH_CODECOV: true
- py_version: "3.12"
WITH_CODECOV: true
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies part I
run: |
sudo apt-get install dssp
pip install --upgrade setuptools pip
- name: Install package and requirements
run: |
pip install --upgrade .
pip install -r requirements-tests.txt
- name: Run pytest with codecoverage
run: |
coverage run $(which pytest) -vv --hypothesis-show-statistics
coverage report --omit='*/bin/pytest'
coverage xml
- if: ${{ matrix.WITH_CODECOV }}
name: Upload coverage codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
pip install -r requirements-tests.txt
- name: Run pylint
run: |
pylint --disable=fixme --fail-under=8.0 vermouth
pylint --disable=fixme --fail-under=9.0 bin/martinize2
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
pip install -r requirements-docs.txt
- name: Run docs
run: |
mkdir -p doc/source/_static
sphinx-build -EW -b html doc/source/ doc/build/html
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/vermouth
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: |
python3 -m pip install build pbr --user
- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1