From 8498fae091050eb5da6b9a4188b52e11df5df215 Mon Sep 17 00:00:00 2001 From: adamghill Date: Sun, 28 Jul 2024 16:16:57 -0400 Subject: [PATCH] Add lint variable. --- .github/workflows/python.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index abaa17fd..37c1c3de 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,8 +1,12 @@ name: Python + on: push: workflow_dispatch: +env: + LINT_PYTHON_VERSION: 3.11 + jobs: lint: runs-on: ubuntu-latest @@ -13,16 +17,14 @@ jobs: fetch-depth: 1 - name: Install Poetry - run: pipx install poetry - - - name: Set Poetry config run: | - poetry config virtualenvs.path ~/.virtualenvs3.11 + pipx install poetry + poetry config virtualenvs.path ~/.virtualenvs$LINT_PYTHON_VERSION - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python $LINT_PYTHON_VERSION uses: actions/setup-python@v3 with: - python-version: 3.11 + python-version: $LINT_PYTHON_VERSION cache: "poetry" - name: Install dependencies @@ -48,10 +50,8 @@ jobs: fetch-depth: 1 - name: Install Poetry - run: pipx install poetry - - - name: Set Poetry config run: | + pipx install poetry poetry config virtualenvs.path ~/.virtualenvs${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }} @@ -61,7 +61,10 @@ jobs: cache: "poetry" - name: Install dependencies - run: poetry install -E minify + run: | + poetry env use ${{ matrix.python-version }} + poetry add django==${{ matrix.django-version }} + poetry install -E minify - name: Fast tests run: poetry run pytest -m 'not slow'