Skip to content

Commit 382fd99

Browse files
committed
👷 Don't lint in GHA except before release
1 parent 0c2df4c commit 382fd99

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ on:
55
tags: [ "*" ]
66
pull_request:
77
jobs:
8-
lint:
9-
name: lint
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v4
14-
with:
15-
python-version: 3.11
16-
- run: python -m pip install --upgrade pip wheel
17-
- run: pip install tox
18-
- run: tox -elint
198
tests:
209
name: ${{ matrix.name }}
2110
runs-on: ubuntu-latest
@@ -63,8 +52,20 @@ jobs:
6352
with:
6453
token: ${{ secrets.CODECOV_TOKEN }}
6554
files: ./coverage.xml
55+
# this duplicates pre-commit.ci, so only run it on tags
56+
# it guarantees that linting is passing prior to a release
57+
lint-pre-release:
58+
if: startsWith(github.ref, 'refs/tags')
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4.0.0
62+
- uses: actions/setup-python@v5
63+
with:
64+
python-version: "3.11"
65+
- run: python -m pip install tox
66+
- run: python -m tox -e lint
6667
release:
67-
needs: [ lint, tests ]
68+
needs: [ tests, lint-pre-release ]
6869
name: PyPI release
6970
if: startsWith(github.ref, 'refs/tags')
7071
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)