Merge pull request #14 from Jepson2k/main #5
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: tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - '**' | |
| pull_request: | |
| paths: | |
| - '**' | |
| jobs: | |
| lint: | |
| name: Lint (pre-commit) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| python -m pip install --upgrade pip | |
| BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" | |
| if git ls-remote --heads https://github.com/Jepson2k/waldoctl.git "$BRANCH" 2>/dev/null | grep -q .; then | |
| pip install "waldoctl @ git+https://github.com/Jepson2k/waldoctl.git@${BRANCH}" | |
| fi | |
| pip install -e ".[dev]" | |
| - name: Run pre-commit | |
| uses: pre-commit/action@v3.0.1 | |
| test: | |
| name: ${{ matrix.os }} / Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ['3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - name: Checkout repository (with submodules) | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Install cross-repo dependencies | |
| shell: bash | |
| run: | | |
| python -m pip install --upgrade pip | |
| BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" | |
| # waldoctl: try matching branch, fall back to tagged version | |
| if git ls-remote --heads https://github.com/Jepson2k/waldoctl.git "$BRANCH" 2>/dev/null | grep -q .; then | |
| pip install "waldoctl @ git+https://github.com/Jepson2k/waldoctl.git@${BRANCH}" | |
| fi | |
| - name: Install package | |
| run: | | |
| pip install -e ".[dev]" pytest-timeout | |
| - name: Show environment | |
| run: | | |
| python -V | |
| pip list | |
| - name: Run tests | |
| env: | |
| PYTHONUNBUFFERED: '1' | |
| PYTHONUTF8: '1' | |
| run: | | |
| pytest |