-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: set up Github linting and type checking hooks
- Loading branch information
1 parent
ec17711
commit d6574f0
Showing
2 changed files
with
62 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,39 @@ | ||
name: "Setup test environment" | ||
description: "Sets up Python, Poetry and dependencies" | ||
|
||
inputs: | ||
python: | ||
description: "Python version to use" | ||
default: "3.11" | ||
required: false | ||
poetry: | ||
description: "Poetry version to use" | ||
default: 1.7.1 | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python }} | ||
|
||
- uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ inputs.poetry }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry lock --no-update | ||
poetry install --no-interaction | ||
shell: bash |
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,23 @@ | ||
name: PR Report | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTHON_VERSION: 3.11 | ||
|
||
jobs: | ||
pre-commit: | ||
name: Linting and type checking | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup poetry environment | ||
uses: ./.github/actions/setup-poetry-environment | ||
- name: Run linting, type checking and testing | ||
uses: pre-commit/[email protected] | ||
with: | ||
extra_args: "--all-files --hook-stage=push" |