Skip to content

Commit

Permalink
Try caching
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Nov 17, 2023
1 parent 55e806d commit bfea9c0
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/k8scompat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on: [push]
jobs:
test:
runs-on: ubuntu-latest
env:
APISERVER_VERSION: 1.28.x
strategy:
matrix:
version:
upstreamApiserverVersion:
- "1.28.x"
- "1.27.x"
- "1.26.x"
Expand All @@ -27,9 +29,32 @@ jobs:
# - "1.10.x"
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Test
run: UPSTREAM_KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path ${{ matrix.version }}) KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path 1.28.x) go test -v ./internal/controllers/reconciliation

- name: Download kubebuilder assets
id: kubebuilder-assets
run: |
echo "::set-output name=dir::$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path $APISERVER_VERSION)"
echo "::set-output name=upstream-dir::$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path ${{ matrix.upstreamApiserverVersion }})"
- name: Cache kubebuilder assets
uses: actions/cache@v2
with:
path: ${{ steps.kubebuilder-assets.dir }}
key: ${{ env.APISERVER_VERSION }}

- name: Cache upstream kubebuilder assets
uses: actions/cache@v2
with:
path: ${{ steps.kubebuilder-assets.upstream-dir }}
key: ${{ matrix.upstreamApiserverVersion }}

- name: Run tests
run: go test -v ./internal/controllers/reconciliation
with:
KUBEBUILDER_ASSETS: ${{ steps.kubebuilder-assets.dir }}
UPSTREAM_KUBEBUILDER_ASSETS: ${{ steps.kubebuilder-assets.upstream-dir }}

0 comments on commit bfea9c0

Please sign in to comment.