docs: small README improvements for branching #35
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: CI | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| pull_request: | |
| branches: | |
| - dev | |
| - master | |
| jobs: | |
| branch-policy: | |
| name: Enforce Branch Policy | |
| if: github.event_name == 'pull_request' && github.base_ref == 'master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require PR head branch to be dev | |
| run: | | |
| if [ "${{ github.head_ref }}" != "dev" ]; then | |
| echo "Pull requests into master must come from dev." | |
| exit 1 | |
| fi | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: | |
| - branch-policy | |
| if: always() && (needs.branch-policy.result == 'success' || needs.branch-policy.result == 'skipped') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . | |
| - name: Validate environment | |
| run: python -m pip check | |
| - name: Run tests | |
| run: pytest -q |