-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.5 KB
/
test-pytest-ruff.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
name: Run pytest, ruff, and pyright
on: [push]
env:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.8.3"
POETRY_URL: https://install.python-poetry.org
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
id: setup_python
- name: Cache Poetry cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Cache Packages
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Install Poetry ${{ env.POETRY_VERSION }}
run: |
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Dependencies
run: poetry install
- name: Run ruff format check
run: poetry run ruff format verified_cogen --check
- name: Run ruff linter
run: poetry run ruff check verified_cogen
- name: Run pyright
run: poetry run pyright verified_cogen
- name: Run pytest
run: poetry run pytest