-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (40 loc) · 1.37 KB
/
check.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
name: checks
on:
workflow_dispatch:
push:
branches:
- "*" # matches every branch that doesn't contain a '/'
- "*/*" # matches every branch containing a single '/'
- "**" # matches every branch
env:
POETRY_VER: 1.7.0
jobs:
run_checks:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Check out GitHub repository ${{ github.repository }}
uses: actions/checkout@v3
- name: Set up Python on ${{ runner.os }}
uses: actions/setup-python@v4
id: setup_python
with:
python-version: '3.10'
- name: Update pip
run: pip install --upgrade pip
- name: Install Poetry ${{ env.POETRY_VER }} on Python ${{ steps.setup_python.outputs.python-version }}
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VER }}
- name: Install dependencies on Python ${{ steps.setup_python.outputs.python-version }}
run: poetry install --no-root --with dev
- name: Check and fix with Ruff
run: |
poetry run ruff check ./openseries/*.py --fix --exit-non-zero-on-fix
poetry run ruff check ./tests/*.py --fix --exit-non-zero-on-fix
- name: Format with Black
run: poetry run black ./openseries/*.py ./tests/*.py
- name: Type check with Mypy
run: poetry run mypy .