-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (68 loc) · 2.28 KB
/
python.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
name: actions
on:
push:
pull_request:
branches:
- $default-branch
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', 'pypy3.8', '3.9', 'pypy3.9', '3.10', '3.11', '3.12']
include:
- os: macos-13
python-version: '3.8'
- os: macos-13
python-version: 'pypy3.8'
- os: macos-13
python-version: '3.9'
- os: macos-13
python-version: 'pypy3.9'
- os: macos-13
python-version: '3.10'
- os: macos-latest
python-version: '3.11'
- os: macos-latest
python-version: '3.12'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install -r requirements_ci.txt
- run: git clone https://github.com/PyCQA/pycodestyle ../pycodestyle
- run: cd ../pycodestyle && python setup.py build && cd -
- run: git clone https://github.com/mbdevpl/argunparse ../argunparse
- run: cd ../argunparse && pip install -r requirements_test.txt && python setup.py build && cd -
- run: git clone https://github.com/python-semver/python-semver ../semver
- run: cd ../semver && python -m build && cd -
- if: matrix.os != 'windows-latest'
run: pip install jupyter # example package that uses metadata.json
- run: python -m coverage run --branch --source . -m unittest -v
- run: python -m coverage run --append --branch --source . -m unittest -v test.test_version
env:
LOGGING_LEVEL: critical
- run: python -m coverage report --show-missing
- run: codecov
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: x64
- run: pip install build
- run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}