-
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.
Showing
4 changed files
with
97 additions
and
1 deletion.
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,25 @@ | ||
name: 'Poetry' | ||
description: 'Install python poetry' | ||
|
||
inputs: | ||
version: | ||
description: "Version of poetry to install" | ||
required: false | ||
default: "1.6.1" | ||
|
||
outputs: | ||
version: | ||
description: "Installed version" | ||
value: ${{ steps.poetry-version.outputs.version }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- run: | | ||
curl -sSL https://install.python-poetry.org | python - --yes --version ${{ inputs.version }} | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
shell: bash | ||
- id: poetry-version | ||
run: echo "version=$(poetry --version)" >> $GITHUB_OUTPUT | ||
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,38 @@ | ||
name: Lint | ||
on: [push, pull_request] | ||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install Poetry | ||
uses: ./.github/actions/poetry | ||
|
||
- name: Install Pre-commit | ||
run: | | ||
poetry install --only ci | ||
env: | ||
POETRY_VIRTUALENVS_CREATE: false | ||
|
||
- name: Restore pre-commit cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: pre-commit-${{ runner.os }}-py${{ env.PYTHON_VERSION }} | ||
|
||
- name: Lint | ||
run: pre-commit run --all-files --show-diff-on-failure |
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,31 @@ | ||
name: Mypy (Type check) | ||
on: [push, pull_request] | ||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 🐍 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install Poetry 🎸 | ||
uses: ./.github/actions/poetry | ||
|
||
- name: Install OS Packages 🧰 | ||
run: | | ||
sudo apt-get update | ||
- name: Install Python Packages 📦 | ||
run: poetry install --without ci | ||
|
||
- name: Run MyPy 🪄 | ||
run: poetry run mypy |
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