From b69d8e2b8b2d150556cfab1e253e97588b9084dd Mon Sep 17 00:00:00 2001 From: Ronny Vedrilla Date: Sun, 11 Feb 2024 14:22:47 +0100 Subject: [PATCH 1/2] #158: Optimise CI linting --- .github/workflows/CI.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9179392..3f7b51a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,6 +10,24 @@ permissions: contents: read jobs: + linting: + name: Linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v4 + with: + python-version: "3.12" + + - name: Install required packages + run: python -m pip install --upgrade tox + + - name: Run linters + run: tox -e lint + + tests: name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest @@ -43,11 +61,6 @@ jobs: ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox - - name: Run linters - if: ${{ matrix.python-version == '3.12' }} - run: | - tox -e lint - - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: From f9802b1337d07517677e331bd931975fb777d4cd Mon Sep 17 00:00:00 2001 From: Ronny Vedrilla Date: Sun, 11 Feb 2024 17:00:35 +0100 Subject: [PATCH 2/2] #158: Added linting to "needs" section of deploy job --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3f7b51a..be0313b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -71,7 +71,9 @@ jobs: deploy: name: Deploy - needs: [tests] + needs: + - linting + - tests runs-on: ubuntu-latest if: github.ref=='refs/heads/main' && github.event_name!='pull_request'