Skip to content

Commit 9a6b7fc

Browse files
committed
refactor workflows: replace inline pre-commit configuration with reusable stage-pre-commit.yml, integrate pre-commit checks into CI orchestrator
1 parent 66d7025 commit 9a6b7fc

3 files changed

Lines changed: 45 additions & 20 deletions

File tree

.github/workflows/ci-orchestrator.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,38 @@ on:
1212
default: 'emulator-5554'
1313

1414
jobs:
15-
# Stage 1: Test
15+
# Stage 1: Pre-commit checks
16+
pre-commit:
17+
uses: ./.github/workflows/stage-pre-commit.yml
18+
with:
19+
os: ubuntu-latest
20+
secrets: inherit
21+
22+
# Stage 2: Test
1623
test:
24+
needs: pre-commit
1725
uses: ./.github/workflows/stage-test.yml
1826
with:
1927
os: ${{ inputs.os }}
2028
secrets: inherit
2129

22-
# Stage 2: Build Package (runs in parallel with validation)
30+
# Stage 3: Build Package (runs in parallel with validation)
2331
build:
2432
needs: test
2533
uses: ./.github/workflows/stage-build.yml
2634
with:
2735
os: ${{ inputs.os }}
2836
secrets: inherit
2937

30-
# Stage 3: Validation (runs in parallel with build)
38+
# Stage 4: Validation (runs in parallel with build)
3139
validation:
3240
needs: test
3341
uses: ./.github/workflows/stage-validation.yml
3442
with:
3543
os: ${{ inputs.os }}
3644
secrets: inherit
3745

38-
# Stage 4: Device Tests (runs after build and validation)
46+
# Stage 5: Device Tests (runs after build and validation)
3947
device-tests:
4048
needs: [build, validation]
4149
uses: ./.github/workflows/stage-device-tests.yml

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pre-commit
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ${{ inputs.os }}
13+
steps:
14+
- uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0 # Fetch all history for all branches
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
cache: 'pip'
23+
cache-dependency-path: |
24+
requirements.txt
25+
setup.py
26+
27+
- name: Install dependencies
28+
run: |
29+
pip install --upgrade pip
30+
pip install pre-commit
31+
32+
- name: Run pre-commit
33+
run: pre-commit run --all-files --show-diff-on-failure

0 commit comments

Comments
 (0)