Skip to content

Commit

Permalink
Add: GitHub action to run tests and static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
wysockipiotr committed May 17, 2024
1 parent 56eab51 commit 5e6aa1f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tests and static analysis

on:
push:
branches: [ main ]

env:
PYTHON_VERSION: "3.12"
POETRY_VERSION: "1.7.1"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Poetry cache
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}

- name: Cache Packages
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry==${{ env.POETRY_VERSION }}
poetry install
- name: Lint
run: poetry run ruff check

- name: Check formatting
run: poetry run ruff format --check

- name: Run tests
run: poetry run pytest

- name: Check types
run: poetry run pyright

- name: Lint imports
run: poetry run lint-imports

0 comments on commit 5e6aa1f

Please sign in to comment.