-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 891 Bytes
/
python.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
name: Python
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff twine build
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint
run: |
ruff --output-format=github --select=E9,F63,F7,F82 --target-version=py39 .
ruff --output-format=github --target-version=py39 .
- name: Test
run: |
python -m unittest discover -s ./tests -p 'test_*.py'
- name: Package
run: |
python -m build
python -m twine check dist/*