Skip to content

Commit 86f6a4d

Browse files
authored
👷 Separate lint step from tests (#160)
1 parent 33b57d3 commit 86f6a4d

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/test.yml

+19-7
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,24 @@ on:
1111
workflow_dispatch:
1212
inputs:
1313
debug_enabled:
14-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
14+
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
1515
required: false
16-
default: 'false'
16+
default: "false"
1717

1818
jobs:
19+
lint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.10"
29+
- run: docker compose build backend
30+
- run: docker compose down -v --remove-orphans
31+
- run: docker compose run -T backend bash /app/scripts/lint.sh
1932

2033
test:
2134
runs-on: ubuntu-latest
@@ -26,18 +39,16 @@ jobs:
2639
- name: Set up Python
2740
uses: actions/setup-python@v5
2841
with:
29-
python-version: '3.10'
42+
python-version: "3.10"
3043
# Allow debugging with tmate
3144
- name: Setup tmate session
3245
uses: mxschmitt/action-tmate@v3
3346
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
3447
with:
3548
limit-access-to-actor: true
36-
- run: docker compose build
49+
- run: docker compose build backend
3750
- run: docker compose down -v --remove-orphans
3851
- run: docker compose up -d backend
39-
- name: Lint
40-
run: docker compose exec -T backend bash /app/scripts/lint.sh
4152
- name: Run tests
4253
run: docker compose exec -T backend bash /app/tests-start.sh "Coverage for ${{ github.sha }}"
4354
- run: docker compose down -v --remove-orphans
@@ -48,10 +59,11 @@ jobs:
4859
path: backend/htmlcov
4960

5061
# https://github.com/marketplace/actions/alls-green#why
51-
alls-green: # This job does nothing and is only used for the branch protection
62+
alls-green: # This job does nothing and is only used for the branch protection
5263
if: always()
5364
needs:
5465
- test
66+
- lint
5567
runs-on: ubuntu-latest
5668
steps:
5769
- name: Decide whether the needed jobs succeeded or failed

0 commit comments

Comments
 (0)