-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (86 loc) · 2.33 KB
/
ci.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
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
jobs:
Test:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- python-version: '3.7'
- python-version: '3.8'
- python-version: '3.9'
- python-version: '3.10'
- python-version: '3.11'
- python-version: '3.12'
- python-version: '3.12'
install-extra: '[sentry]'
services:
redis:
image: redis
ports:
- 6379:6379
env:
REDIS_URL: 'redis://localhost:6379/0'
SENTRY_DSN: 'http://user:pass@localhost:12340/foo'
steps:
- uses: actions/checkout@v2
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python-version }}'
- run: 'pip install -e ".$EXTRA" -e ".[test]"'
env:
EXTRA: '${{ matrix.install-extra }}'
- run: py.test -vvv --cov .
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: 'Python ${{ matrix.python-version }}'
Lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- uses: pre-commit/[email protected]
Mypy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- run: pip install -e .[sentry] mypy==1.0.0 types-redis
- run: mypy --strict --install-types --non-interactive --show-error-codes minique
Build:
runs-on: ubuntu-22.04
needs: [ Lint, Mypy, Test ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- run: pip install build twine
- run: python -m build .
- run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: build
path: dist
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
print_hash: true
password: ${{ secrets.PYPI_API_TOKEN }}