-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (84 loc) · 2.46 KB
/
ci.yaml
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
113
# https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
# https://docs.github.com/en/actions/guides/building-and-testing-python
name: ci
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 0 * * 0' # at 00:00 every Sunday
jobs:
tests:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
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 --upgrade pip
pip install black flake8 mypy pytest pytest-cov
pip freeze
- name: Install package
run: |
pip install -e .
- name: Check types
run: |
./scripts/check_types
- name: Check linter
run: |
./scripts/check_linter
- name: Check format
run: |
./scripts/check_fmt
- name: Tests
run: |
./scripts/test
- name: Upload to codecov.io
if: matrix.python-version == '3.10'
# https://github.com/codecov/codecov-action
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
deploy:
needs: tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install wheel
run: pip install wheel
- name: Package
run: python setup.py sdist bdist_wheel
- name: Check output
run: ls -la dist
- name: Check deploy condition
run: |
echo "github.ref: ${{github.ref}}"
echo "github.event_name: ${{github.event_name}}"
- name: Run integration test
run: |
set -e
pip install dist/*.whl
mkdir rundir
cd rundir
echo -e "\nRunning example:"
FORCE_COLOR=3 python ../examples/example.py
- name: Publish to PyPI
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true