Record dependency and CI verification #11
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| stdlib-tests: | |
| name: Python ${{ matrix.python-version }} / ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| python-version: ["3.10", "3.13"] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| env: | |
| PYTHONIOENCODING: utf-8 | |
| PYTHONUTF8: "1" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Check tracked source hygiene | |
| run: >- | |
| python -c "import subprocess, sys; | |
| paths = subprocess.check_output(['git', 'ls-files'], text=True).splitlines(); | |
| generated = [path for path in paths if path.endswith(('.pyc', '.pyo')) or '__pycache__/' in path]; | |
| allowed_logs = {'examples/synthetic_demo.trc', 'examples/synthetic_encoding_edge_cases.trc'}; | |
| unexpected_logs = [path for path in paths if path.lower().endswith(('.trc', '.log')) and path not in allowed_logs]; | |
| problems = generated + unexpected_logs; | |
| print('Source hygiene passed.' if not problems else 'Unexpected tracked files:\n' + '\n'.join(problems)); | |
| sys.exit(bool(problems))" | |
| - name: Install package | |
| run: python -m pip install -e . | |
| - name: Verify command-line entry point | |
| run: python -m hslviewer --help | |
| - name: Run standard-library test suite | |
| run: python -m unittest discover -s tests -v | |
| - name: Verify wheel build | |
| run: python -m pip wheel . --no-deps --wheel-dir wheelhouse |