fix(release): target repository explicitly #6
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: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| name: Static quality and data integrity | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| cache: pip | |
| cache-dependency-path: requirements*.txt | |
| - run: python -m pip install -r requirements-dev.txt | |
| - name: Install shell quality tooling | |
| run: sudo apt-get update && sudo apt-get install -y shellcheck | |
| - name: Python format, lint, and types | |
| run: | | |
| ruff format --check rewardharness src scripts examples tests vanilla | |
| ruff check rewardharness src scripts examples tests vanilla | |
| mypy rewardharness | |
| - name: Rating and shell integrity | |
| run: | | |
| python scripts/check_rating_integrity.py | |
| python scripts/check_migration_coverage.py | |
| python scripts/check_release_metadata.py | |
| pip-audit -r requirements.txt | |
| for file in scripts/*.sh scripts/lib/*.sh; do bash -n "$file"; done | |
| shellcheck scripts/*.sh scripts/lib/*.sh | |
| test: | |
| name: Test on Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: requirements*.txt | |
| - name: Install development dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements-dev.txt | |
| - name: Run test suite with coverage | |
| run: python -m pytest tests/ -v --tb=short --cov=rewardharness --cov-report=term-missing | |
| - name: Smoke-test library inspection | |
| run: python -m rewardharness.cli inspect | |
| package: | |
| name: Validate distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| cache: pip | |
| - name: Install release tooling | |
| run: python -m pip install build twine | |
| - name: Build and check distributions | |
| run: | | |
| python -m build | |
| python -m twine check dist/* | |
| - name: Test wheel installation | |
| run: | | |
| python -m venv /tmp/rewardharness-wheel | |
| /tmp/rewardharness-wheel/bin/pip install dist/*.whl | |
| /tmp/rewardharness-wheel/bin/rewardharness --version | |
| /tmp/rewardharness-wheel/bin/rewardharness inspect | |
| /tmp/rewardharness-wheel/bin/rewardharness release-status | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: distributions | |
| path: dist/ | |
| if-no-files-found: error |