Skip to content

Commit

Permalink
Make POETRY_VERSION variable in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
doyled-it committed Dec 12, 2023
1 parent e5d4bb8 commit ea7fb12
Showing 1 changed file with 54 additions and 13 deletions.
67 changes: 54 additions & 13 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ on:
workflow_dispatch:

jobs:
common-setup:
flake8:
runs-on: ubuntu-latest

container:
image: python:3.9
steps:
- uses: actions/checkout@v4.1.0
- name: Check Python version
run: python --version

- name: Install Poetry
run: |
export POETRY_VERSION=1.4.0
export POETRY_VERSION={{ variables.POETRY_VERSION }}
curl -sSkL https://install.python-poetry.org | python -
export PATH=$PATH:$HOME/.local/bin
poetry --version
Expand All @@ -23,50 +25,89 @@ jobs:
sudo apt update
sudo apt -y install libgl1-mesa-dev
flake8:
runs-on: ubuntu-latest
needs: common-setup
container:
image: python:3.9
steps:
- uses: actions/checkout@v4.1.0
- name: Install Dependencies
run: poetry install --only dev

- name: Run Flake8
run: poetry run flake8 .

black:
runs-on: ubuntu-latest
needs: common-setup
container:
image: python:3.9
steps:
- uses: actions/checkout@v4.1.0
- name: Check Python version
run: python --version

- name: Install Poetry
run: |
export POETRY_VERSION={{ variables.POETRY_VERSION }}
curl -sSkL https://install.python-poetry.org | python -
export PATH=$PATH:$HOME/.local/bin
poetry --version
- name: Install libgl1-mesa-dev
run: |
sudo apt update
sudo apt -y install libgl1-mesa-dev
- name: Install Dependencies
run: poetry install --only dev

- name: Run Black
run: poetry run black --check ./

mypy:
runs-on: ubuntu-latest
needs: common-setup
container:
image: python:3.9
steps:
- uses: actions/checkout@v4.1.0
- name: Check Python version
run: python --version

- name: Install Poetry
run: |
export POETRY_VERSION={{ variables.POETRY_VERSION }}
curl -sSkL https://install.python-poetry.org | python -
export PATH=$PATH:$HOME/.local/bin
poetry --version
- name: Install libgl1-mesa-dev
run: |
sudo apt update
sudo apt -y install libgl1-mesa-dev
- name: Install Dependencies
run: poetry install --only dev

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

isort:
runs-on: ubuntu-latest
needs: common-setup
container:
image: python:3.9
steps:
- uses: actions/checkout@v4.1.0
- name: Check Python version
run: python --version

- name: Install Poetry
run: |
export POETRY_VERSION={{ variables.POETRY_VERSION }}
curl -sSkL https://install.python-poetry.org | python -
export PATH=$PATH:$HOME/.local/bin
poetry --version
- name: Install libgl1-mesa-dev
run: |
sudo apt update
sudo apt -y install libgl1-mesa-dev
- name: Install Dependencies
run: poetry install --only dev

- name: Run isort
run: poetry run isort --check --profile black --trailing-comma -m=3 .

0 comments on commit ea7fb12

Please sign in to comment.