Skip to content

Commit

Permalink
Dedup versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Nov 17, 2023
1 parent 9e019f3 commit d3b9794
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/k8scompat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
- cron: 0 0 * * *

env:
setupEnvtestCmd: "go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest"

jobs:
buildMatrix:
runs-on: ubuntu-latest
Expand All @@ -19,7 +22,7 @@ jobs:
- name: Generate test matrix using setup-envtest
id: build
run: |
echo "matrix=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest -p env list | awk '/)/ {print $2}' | awk -F'.' '{print $2}' | jq -c --slurp 'map(tostring)')" >> $GITHUB_OUTPUT
echo "matrix=$($setupEnvtestCmd -p env list | awk '/)/ {print $2}' | awk -F'.' '{print $2}' | jq -c --slurp 'map(tostring) | unique')" >> $GITHUB_OUTPUT
test:
name: Kubernetes 1.${{ matrix.downstreamApiserverMinorVersion }}
Expand All @@ -41,8 +44,8 @@ jobs:

- name: Download kubebuilder assets
run: |
echo "UPSTREAM_KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path ${{ env.upstreamApiserverVersion }})" >> $GITHUB_ENV
echo "DOWNSTREAM_KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path 1.${{ matrix.downstreamApiserverMinorVersion }}.x)" >> $GITHUB_ENV
echo "UPSTREAM_KUBEBUILDER_ASSETS=$($setupEnvtestCmd use -p path ${{ env.upstreamApiserverVersion }})" >> $GITHUB_ENV
echo "DOWNSTREAM_KUBEBUILDER_ASSETS=$($setupEnvtestCmd use -p path 1.${{ matrix.downstreamApiserverMinorVersion }}.x)" >> $GITHUB_ENV
- name: Run tests
run: go test -v ./internal/controllers/reconciliation
Expand Down

0 comments on commit d3b9794

Please sign in to comment.