Skip to content

Commit

Permalink
#158: Optimise CI linting (#159)
Browse files Browse the repository at this point in the history
* #158: Optimise CI linting

* #158: Added linting to "needs" section of deploy job
  • Loading branch information
GitRon authored Feb 11, 2024
1 parent d75a08b commit 0ff9ce6
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -58,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'

Expand Down

0 comments on commit 0ff9ce6

Please sign in to comment.