-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (49 loc) · 1.48 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
---
name: Test and publish
on: [push]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', pypy-3.7, pypy-3.8, pypy-3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .
python -m pip install -r test_requirements.txt
python -m pip install flake8
python -m pip install isort
python -m pip install black
- name: Run checks
run: pymake checks
- name: Test with pytest
run: pymake covtest
publish:
needs: [test]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install .
python -m pip install --upgrade build
python -m pip install --upgrade twine
- name: Check that tag matches package version
run: python check_tag.py
- name: Build and publish package
run: pymake publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{secrets.PYPI_API_TOKEN}}