-
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (127 loc) · 3.92 KB
/
Copy pathbuild.yml
File metadata and controls
131 lines (127 loc) · 3.92 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
name: Build
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .[lint,test]
- name: Run linters
run: python ci/run_linters.py
env:
COLORLABELS_TTY: 1
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
env:
PYTEST_ADDOPTS: --color=yes
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- 'pypy-3.7'
- 'pypy-3.8'
- 'pypy-3.9'
experimental: [false]
include:
- os: ubuntu-18.04
python-version: '3.4'
experimental: false
- os: ubuntu-20.04
python-version: '3.5'
experimental: false
- os: ubuntu-20.04
python-version: '3.6'
experimental: false
- os: ubuntu-20.04
python-version: 'pypy-3.6'
experimental: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .[test]
- name: First round test (local code, with coverage)
run: |
python ci/path_checker.py
coverage run -m pytest
- name: Run doctest if on latest Python
if: ${{ matrix.python-version == '3.11' }}
run: pytest --doctest-only bpc_utils tests
- name: Second round test (installed package, without coverage)
run: |
mv bpc_utils bpc_utils~
python ci/path_checker.py strict
pytest
mv bpc_utils~ bpc_utils
- name: Upload coverage report
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }}
run: |
pip install codecov
codecov
publish:
runs-on: ubuntu-latest
needs: [lint, test]
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install --upgrade build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Changelog
uses: Bullrich/generate-release-changelog@master
id: changelog
env:
REPO: ${{ github.repository }}
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
# allowUpdates: true
artifacts: |
dist/*
body: |
${{ steps.changelog.outputs.changelog }}
name: PyBPC Utilities ${{ github.ref_name }}
tag: "${{ github.ref_name}}"
token: "${{ secrets.GITHUB_TOKEN }}"