-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: GitHub action to run tests and static analysis
- Loading branch information
1 parent
56eab51
commit 5e6aa1f
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |