-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (77 loc) · 2.1 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
77
78
79
80
81
82
---
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
create:
tags:
- "*"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Cache pre-commit
uses: actions/cache@v3
with:
path: |
~/.cache/black
~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/[email protected]
unit-test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: pip install poetry && poetry install
- name: Test
run: poetry run pytest
smoke-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install Dependencies
run: pip install poetry && poetry install
- name: Run smoke test
run: poetry run ./tests/run-smoketest.sh
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install Dependencies
run: pip install poetry && poetry install
- name: Run Coverage
run: poetry run pytest --cov=.
publish:
runs-on: ubuntu-latest
needs: [lint, unit-test, smoke-test, coverage]
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v1
- name: Build and publish to PyPi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}