Skip to content

Commit

Permalink
add test and lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrenault committed Nov 21, 2024
1 parent 8d6ec07 commit 3d7b182
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main

env: # environment variables (available in any part of the action)
PYTHON_VERSION: 3.12

jobs:
lint-test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

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

- name: Check lock file
run: poetry lock --check

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Test with pytest
run: poetry run pytest

- name: Run black
run: poetry run black --check --config ./pyproject.toml .

- name: Run mypy
run: poetry run mypy --config-file=pyproject.toml

- name: Run ruff
run: poetry run ruff check

0 comments on commit 3d7b182

Please sign in to comment.