11name : CI
22
3- # Event triggers define when this workflow runs. Bumping to trigger
4- # We target pushes to the main branch and any pull request targeting the main branch.
53on :
64 push :
75 branches :
86 - " master"
97 - " tim-fiola-github-actions-migration"
10- tags : [ "v*" ] # Run on version tags for release readiness
8+ tags :
9+ - " v*"
1110 pull_request :
1211 branches :
1312 - " master"
14- # Allows manual triggering from the GitHub Actions tab
1513 workflow_dispatch : {}
1614
17- # Concurrency groups allow us to cancel in-progress builds for the same PR.
18- # This saves runner minutes and ensures developers see the result of their latest commit faster.
1915concurrency :
2016 group : ${{ github.workflow }}-${{ github.ref }}
2117 cancel-in-progress : true
2218
2319jobs :
24- # -----------------------------------------------------------------------------
25- # JOB 1: Code Quality (Static Analysis)
26- # This job runs first. If it fails, the expensive test matrix is skipped.
27- # -----------------------------------------------------------------------------
2820 quality :
2921 name : Code Quality Check
3022 runs-on : ubuntu-latest
3123 steps :
3224 - name : Checkout Repository
3325 uses : actions/checkout@v4
3426 with :
35- fetch-depth : 1 # Shallow clone is sufficient for linting
27+ fetch-depth : 1
3628
3729 - name : Set up Python 3.10
3830 uses : actions/setup-python@v5
@@ -43,64 +35,49 @@ jobs:
4335 - name : Install Linting Tools
4436 run : |
4537 python -m pip install --upgrade pip
46- # We attempt to install from requirements_dev.txt, but fallback to direct install
47- # to ensure the pipeline is robust even if the file is missing/renamed.
4838 if [ -f requirements_dev.txt ]; then
4939 pip install -r requirements_dev.txt
5040 else
5141 pip install black flake8
5242 fi
5343
5444 - name : Check Formatting (Black)
55- # confirms usage of Black. --check ensures it fails on unformatted code .
56- run : black --check
45+ # Fixed: Added space between --check and .
46+ run : black --check .
5747
5848 - name : Run Linter (Flake8)
59- # confirms usage of Flake8.
60- # We report statistics and exit with error on syntax errors (E9, F63, etc.)
61- run : flake8. --count --select=E9,F63,F7,F82 --show-source --statistics
49+ # Fixed: Added space between flake8 and .
50+ run : flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
6251
63- # -----------------------------------------------------------------------------
64- # JOB 2: Test Matrix (Unit & Integration Tests)
65- # This runs the actual simulation engine tests across multiple Python versions.
66- # -----------------------------------------------------------------------------
6752 tests :
6853 name : Test (Python ${{ matrix.python-version }})
69- needs : quality # Dependency: Quality job must pass first
54+ needs : quality
7055 runs-on : ubuntu-latest
71-
56+
7257 strategy :
73- fail-fast : false # Don't cancel other matrix jobs if one version fails
58+ fail-fast : false
7459 matrix :
75- # [1, 2, 3] inform this list.
76- # We include 3.11 to satisfy issue #59.
77- # We include pypy-3.9 to satisfy performance requirements.
7860 python-version : ["3.8", "3.9", "3.10", "3.11", "pypy-3.9"]
7961
8062 steps :
8163 - name : Checkout Repository
8264 uses : actions/checkout@v4
8365 with :
84- # Fetch full history might be needed if tests rely on git tags/versioning
85- fetch-depth : 0
66+ fetch-depth : 0
8667
8768 - name : Set up Python ${{ matrix.python-version }}
8869 uses : actions/setup-python@v5
8970 with :
9071 python-version : ${{ matrix.python-version }}
91- cache : ' pip' # Hashes requirements.txt for caching
72+ cache : ' pip'
9273
9374 - name : Install Dependencies
94- # This step handles the 'numpy evolutions' risk by installing pinned requirements first.
9575 run : |
9676 python -m pip install --upgrade pip
9777 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
9878 if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
99- # Install the package itself in editable mode
100- pip install -e.
79+ pip install -e .
10180
10281 - name : Run Tests
103- # confirms "python -m pytest" usage.
104- # The verbose flag helps in debugging convergence issues in logs.
10582 run : |
10683 python -m pytest --verbose
0 commit comments