-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (73 loc) · 1.95 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:
- '**'
pull_request: {}
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: install deps
run: pip install -r requirements-test.txt
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
test:
name: Test py${{ matrix.python }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.9', '3.10', '3.11', '3.12']
env:
PYTHON: ${{ matrix.python }}
OS: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- run: pip install -r requirements-test.txt
- name: test
run: coverage run -m pytest --durations=10
env:
COVERAGE_FILE: .coverage.${{ runner.os }}-py${{ matrix.python }}-without-dotenv
CONTEXT: ${{ runner.os }}-py${{ matrix.python }}-without-dotenv
- run: coverage combine
- run: coverage xml
- uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
env_vars: PYTHON,OS
release:
name: Release
needs: [lint, test]
if: success() && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: install
run: pip install -U build
- name: build
run: python -m build
- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1