-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (61 loc) · 1.72 KB
/
publish.yml
File metadata and controls
78 lines (61 loc) · 1.72 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
name: Publish
on:
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1.1.1
with:
version: 1.1.4
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.virtualenvs
- name: Install Dependencies
run: poetry install
- name: Code Quality
run: poetry run black . --check
continue-on-error: true
- name: Analyse with MyPy
run: poetry run mypy src
- name: Lint with PyLint
run: poetry run pylint src/labthings/
- name: Test with pytest
run: poetry run pytest
publish:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install and configure Poetry
uses: snok/install-poetry@v1.1.1
with:
version: 1.1.4
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.virtualenvs
- name: Set Poetry config
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
run: |
poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI"
- name: Build with Poetry
run: poetry build
- name: Publish with Poetry
run: poetry publish