-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (101 loc) · 3.02 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
push:
branches:
- master
- "release/**"
- "dev/**"
tags: [v*]
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.12"]
include:
- os: windows-latest
python-version: '3.8'
name: Run linting on Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Coverage
run: poetry run poe cov
- name: Run Lint
run: poetry run poe lint
- name: Run Black
run: poetry run poe black --check
- name: Run typechecks
run: poetry run poe typing
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10", ]
include:
- os: windows-latest
python-version: '3.8'
name: Run unittests on Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# cache: 'poetry' # cache is causing problems
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Install dev dependencies
run: poetry install
- name: Run the tests for selector loop
run: poetry run pytest
- name: Run the tests for proactor loop
if: ${{ matrix.os == 'windows-latest' }}
run: poetry run pytest --proactor
testall:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Tests (matrix)
needs: tests
steps:
- name: Check test matrix status
if: ${{ needs.tests.result != 'success' }}
run: exit 1
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
needs:
- tests
- lint
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Build a binary wheel and a source tarball
run: poetry build
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}