Skip to content

Commit

Permalink
Add workflow to test minimal dependencies (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Nov 12, 2024
1 parent 9168292 commit d4cf1a6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test-kr8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,26 @@ jobs:
- name: Debug k8s resources
if: always()
run: kubectl get all -A

minimal-deps:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
# Test the minimal and maximal Python versions only
python-version: ["3.8", "3.12"]
kubernetes-version: ["1.31.2"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
node_image: kindest/node:v${{ matrix.kubernetes-version }}
- name: Install kr8s
run: pip install -e .
- name: Ensure kr8s works
run: python -c "import kr8s; print(kr8s.get('nodes'))"
9 changes: 7 additions & 2 deletions ci/update-kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,14 @@ def get_versions():
def update_workflow(versions, workflow_path):
workflow_path = Path(workflow_path)
workflow = yaml.load(workflow_path)
workflow["jobs"]["test"]["strategy"]["matrix"]["kubernetes-version"][0] = versions[
latest_kind_container = versions[0]["latest_kind_container"]
if "minimal-deps" in workflow["jobs"]:
workflow["jobs"]["minimal-deps"]["strategy"]["matrix"]["kubernetes-version"][
0
] = latest_kind_container
workflow["jobs"]["test"]["strategy"]["matrix"]["kubernetes-version"][
0
]["latest_kind_container"]
] = latest_kind_container
workflow["jobs"]["test"]["strategy"]["matrix"]["include"] = []
for version in versions[1:]:
workflow["jobs"]["test"]["strategy"]["matrix"]["include"].append(
Expand Down

0 comments on commit d4cf1a6

Please sign in to comment.