-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (109 loc) · 3.04 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
113
114
name: CI
on:
pull_request:
push:
branches:
- '*'
tags:
- 'v*'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Set Up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install flake8 pytest mypy
- name: Flake8
run: python -m flake8
- name: MyPy
run: python -m mypy aiuti --strict
test:
name: Test
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
python:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- 'pypy-3.8'
- 'pypy-3.9-v7.3.12'
- 'pypy-3.10-v7.3.12'
os: ['ubuntu-latest', 'macOS-latest', 'windows-latest']
exclude:
- python: 'pypy-3.8'
os: 'windows-latest'
- python: 'pypy-3.9-v7.3.12'
os: 'windows-latest'
- python: 'pypy-3.10-v7.3.12'
os: 'windows-latest'
steps:
- uses: actions/checkout@v4.1.1
- name: Set Up Python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U -r requirements.txt pytest-coverage codecov
- name: Run Tests
run: python -m pytest -v --cov=aiuti --cov-report=xml
- name: Upload Coverage
run: python -m codecov --token=${{ secrets.CODECOV_TOKEN }}
publish:
if: startsWith(github.ref, 'refs/tags/')
name: Create Release
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Set Up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Change Log
id: change_log
run: >-
TEXT=$(
git --no-pager log --pretty=format:'- %s (%h)'
`git describe --abbrev=0 --tags HEAD^1`..HEAD
)
echo "text=$TEXT" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Change Log:
${{ steps.change_log.output.text }}
draft: true # Give me a moment to edit in the description
prerelease: false
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}