-
-
Notifications
You must be signed in to change notification settings - Fork 16
76 lines (65 loc) · 2.07 KB
/
main.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
---
name: test & publish
on:
pull_request: ~
push:
branches:
- master
jobs:
test:
name: Test python-${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: setup.py
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pycodestyle unittest-xml-reporting
pip install .
- name: Test
run: python -m xmlrunner discover -v -o test-results/test/
- name: Pycodestyle
run: pycodestyle cr8
- name: Upload results to wacklig
env:
WACKLIG_TOKEN: ${{ secrets.WACKLIG_TOKEN }}
run: |
curl -s https://raw.githubusercontent.com/pipifein/wacklig-uploader/master/wacklig.py | python - --token "$WACKLIG_TOKEN" || echo "Upload to wacklig failed"
publish:
name: Build & publish package to pypi
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
cache: "pip"
cache-dependency-path: setup.py
- name: Build package
run: |
python -m pip install twine wheel
python setup.py sdist bdist_wheel
twine check dist/*.tar.gz
- name: Publish package
uses: mfussenegger/gh-action-pypi-publish@63c35b2cc56443d44589efa87a970cc1895ce79a
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.pypi }}