Improve GitHub Actions test pipeline
- Make YAML validation failures fail the build (removed continue-on-error) - Split flake8 into syntax errors (fails) and style warnings (continues) - Add concurrency control to cancel redundant runs - Add Python 3.10, 3.11, and 3.12 matrix testing for better compatibility
This commit is contained in:
parent
562711555e
commit
94cc147fed
1 changed files with 10 additions and 3 deletions
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
|
|
@ -6,12 +6,17 @@ on:
|
|||
pull_request:
|
||||
branches: [ main, master, develop ]
|
||||
|
||||
# Cancel in-progress runs when a new commit is pushed
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.11']
|
||||
python-version: ['3.10', '3.11', '3.12']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
|
@ -54,7 +59,6 @@ jobs:
|
|||
run: |
|
||||
python activity_yaml_validator.py research/SPEC.yaml
|
||||
python activity_yaml_validator.py research/activity*.yaml
|
||||
continue-on-error: true
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -79,10 +83,13 @@ jobs:
|
|||
black --check --diff .
|
||||
continue-on-error: true
|
||||
|
||||
- name: Lint with flake8
|
||||
- name: Lint with flake8 (syntax errors)
|
||||
run: |
|
||||
# Stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
|
||||
- name: Lint with flake8 (style warnings)
|
||||
run: |
|
||||
# Exit-zero treats all errors as warnings
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
continue-on-error: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue