Introduce SSOT spec pipeline with ANTLR AST parser, conformance corpu… #26
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Static analysis and formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Verify batch-spec submodule | |
| run: | | |
| test -f vendor/batch-spec/VERSION || { | |
| echo "vendor/batch-spec is missing. Ensure checkout uses submodules: recursive." | |
| exit 1 | |
| } | |
| - name: Fetch batch-spec tags | |
| run: git -C vendor/batch-spec fetch --tags origin | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| - name: Run quality checks | |
| run: | | |
| python -m black --check src tests scripts | |
| python -m isort --check-only src tests scripts | |
| python -m autopep8 --select=W291,W293 --diff -r src tests scripts | |
| python scripts/spec/validate_spec.py | |
| python scripts/spec/validate_corpus.py | |
| python scripts/spec/generate_rules.py --check | |
| python scripts/spec/generate_parser.py --check | |
| python scripts/spec/generate_expansion.py --check | |
| python scripts/spec/generate_commands.py --check | |
| python scripts/spec/generate_docs.py --check | |
| python scripts/spec/generate_grammar_rules.py --check | |
| python scripts/spec/audit_ssot.py --strict | |
| python -m mypy src/blinter tests scripts/verify.py | |
| python -m pylint src/blinter | |
| python -m bandit -r src/blinter -c pyproject.toml -ll -q | |
| python -m pip-audit -r requirements.txt -r requirements-dev.txt | |
| test-python: | |
| name: pytest (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Fetch batch-spec tags | |
| run: git -C vendor/batch-spec fetch --tags origin | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| - name: Run tests | |
| run: | | |
| python -m pytest --no-cov tests/test_spec_corpus.py tests/test_spec_parser.py | |
| python -m pytest | |
| test-windows-exe: | |
| name: Windows executable smoke tests | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Create virtual environment | |
| run: python -m venv venv | |
| - name: Install dependencies in virtual environment | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install --upgrade wheel | |
| python -m pip install --upgrade pyinstaller | |
| python -m pip install --upgrade -r requirements-dev.txt | |
| shell: pwsh | |
| - name: Generate version info file | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| python scripts/generate_file_version_info.py | |
| shell: pwsh | |
| - name: Build executable | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| pyinstaller Blinter.spec | |
| shell: pwsh | |
| - name: Verify executable exists | |
| run: | | |
| if (-not (Test-Path -Path "dist\Blinter.exe" -PathType Leaf)) { | |
| throw "dist\Blinter.exe was not produced by PyInstaller" | |
| } | |
| shell: pwsh | |
| - name: Install Blinter for parity checks | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| python -m pip install -e . | |
| shell: pwsh | |
| - name: Run cmd.exe corpus oracle | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| python scripts/spec/cmd_oracle.py | |
| shell: pwsh | |
| - name: Smoke test executable | |
| run: .\scripts\test_exe_smoke.ps1 -ExePath .\dist\Blinter.exe | |
| shell: pwsh |