Skip to content

Commit 3d9d0fd

Browse files
committed
Added krew validation pipeline
1 parent 885b1b8 commit 3d9d0fd

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,58 @@ jobs:
133133
- name: Run integration tests
134134
run: |
135135
go test -v -tags=integration ./test/integration/... -timeout 10m
136+
137+
validate-krew-manifest:
138+
name: Validate Krew Manifest
139+
runs-on: ubuntu-latest
140+
env:
141+
KREW_VERSION: v0.4.5
142+
GO111MODULE: on
143+
steps:
144+
145+
- name: Setup Go
146+
uses: actions/setup-go@v3
147+
with:
148+
go-version: '1.22'
149+
id: go
150+
151+
- name: Go module cache
152+
uses: actions/cache@v3
153+
with:
154+
path: ~/go/pkg/mod
155+
key: ${{ runner.os }}-go-${{ env.KREW_VERSION }}
156+
restore-keys: |
157+
${{ runner.os }}-go-
158+
159+
- name: Check out PR branch
160+
uses: actions/checkout@v3
161+
with:
162+
fetch-depth: 0 # disable shallow clones
163+
- name: Install kubectl
164+
run: |
165+
set -euo pipefail
166+
sudo curl -fsSL -o /usr/bin/kubectl https://dl.k8s.io/release/v1.18.8/bin/linux/amd64/kubectl
167+
sudo chmod +x /usr/bin/kubectl
168+
169+
- name: Install krew
170+
run: |
171+
set -euo pipefail
172+
cd "$(mktemp -d)"
173+
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew.yaml"
174+
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew-linux_amd64.tar.gz"
175+
tar zxvf krew-linux_amd64.tar.gz
176+
./krew-linux_amd64 install --manifest=krew.yaml --archive=krew-linux_amd64.tar.gz
177+
178+
- name: Install validate-krew-manifest plugin
179+
run : |
180+
set -euo pipefail
181+
export GOBIN=$HOME/bin
182+
go install sigs.k8s.io/krew/cmd/validate-krew-manifest@${KREW_VERSION}
183+
184+
- name: Validate updated plugin manifests
185+
if: github.event_name == 'pull_request'
186+
run : |
187+
set -x
188+
set -euo pipefail
189+
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
190+
$HOME/bin/validate-krew-manifest -manifest .krew.yaml

0 commit comments

Comments
 (0)