Skip to content

Commit 3e3eeea

Browse files
committed
ci: add waldoctl branch-matching for cross-repo dev branches
1 parent acba9c7 commit 3e3eeea

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ jobs:
2020
uses: actions/setup-python@v5
2121
with:
2222
python-version: '3.11'
23-
- name: Install dependencies for mypy
23+
- name: Install dependencies
24+
shell: bash
2425
run: |
2526
python -m pip install --upgrade pip
27+
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
28+
if git ls-remote --heads https://github.com/Jepson2k/waldoctl.git "$BRANCH" 2>/dev/null | grep -q .; then
29+
pip install "waldoctl @ git+https://github.com/Jepson2k/waldoctl.git@${BRANCH}"
30+
fi
2631
pip install -e ".[dev]"
2732
- name: Run pre-commit
2833
uses: pre-commit/action@v3.0.1
@@ -47,9 +52,18 @@ jobs:
4752
cache: pip
4853
cache-dependency-path: pyproject.toml
4954

50-
- name: Upgrade pip and install dependencies
55+
- name: Install cross-repo dependencies
56+
shell: bash
5157
run: |
5258
python -m pip install --upgrade pip
59+
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
60+
# waldoctl: try matching branch, fall back to tagged version
61+
if git ls-remote --heads https://github.com/Jepson2k/waldoctl.git "$BRANCH" 2>/dev/null | grep -q .; then
62+
pip install "waldoctl @ git+https://github.com/Jepson2k/waldoctl.git@${BRANCH}"
63+
fi
64+
65+
- name: Install package
66+
run: |
5367
pip install -e ".[dev]" pytest-timeout
5468
5569
- name: Show environment

0 commit comments

Comments
 (0)