Restructure CI pipeline for proper sequencing and parallelization

- Merge lint and test into single 'verify' job for guaranteed sequential execution
- Build job runs in parallel for each target, but waits for verify to complete
- Ensures order: verify (lint → test) → build (parallel) → publish-packages
- Fixes Gitea Actions job dependency handling
This commit is contained in:
Maze X
2026-03-27 18:08:42 +01:00
parent bd2f990754
commit fdd1802bd5

View File

@@ -7,8 +7,8 @@ on:
branches: [ main ]
jobs:
lint:
name: Lint and Format Check
verify:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -18,29 +18,16 @@ jobs:
with:
python-version: '3.11'
- name: Install pre-commit
- name: Lint - Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
- name: Lint - Run pre-commit
run: pre-commit run --all-files
test:
name: Unit Tests
runs-on: ubuntu-latest
needs: [ lint ]
steps:
- uses: actions/checkout@v4
- name: Test - Install dependencies
run: pip install pyserial pytest
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install pyserial pytest
- name: Run integration tests (client validation)
- name: Test - Run integration tests
run: |
cd test
python -m pytest kiss_client.py -v 2>/dev/null || echo "Note: Full integration tests require simulator"
@@ -49,7 +36,7 @@ jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
needs: [ test ]
needs: [ verify ]
strategy:
fail-fast: false
matrix:
@@ -65,15 +52,15 @@ jobs:
with:
python-version: '3.11'
- name: Install PlatformIO
run: pip install platformio
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio-${{ hashFiles('**/platformio.ini') }}
- name: Install PlatformIO
run: pip install platformio
- name: Build ${{ matrix.target }}
run: pio run -e ${{ matrix.target }}
@@ -122,12 +109,12 @@ jobs:
summary:
name: Build Summary
runs-on: ubuntu-latest
needs: [ lint, test, build, publish-packages ]
needs: [ verify, build, publish-packages ]
if: always()
steps:
- name: Check status
run: |
if [ "${{ needs.lint.result }}" = "failure" ] || [ "${{ needs.test.result }}" = "failure" ] || [ "${{ needs.build.result }}" = "failure" ]; then
if [ "${{ needs.verify.result }}" = "failure" ] || [ "${{ needs.build.result }}" = "failure" ]; then
echo "❌ CI failed"
exit 1
fi