-
Notifications
You must be signed in to change notification settings - Fork 93
40 lines (36 loc) · 1.42 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: test
on:
push:
tags:
- "**"
branches:
- master
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- run: go test -v ./...
- name: Validate krew-index manifest
run: |
set -euo pipefail
KREW_VERSION=v0.4.4
pushd "$(mktemp -d)"
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew.yaml"
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew-linux_amd64.tar.gz"
tar zxvf krew-linux_amd64.tar.gz
./krew-linux_amd64 install --manifest=krew.yaml --archive=krew-linux_amd64.tar.gz
popd
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
export TAG=$(curl -sL https://github.com/boz/kail/releases/latest -H "Accept: application/json" | jq -r .tag_name)
ls -la ./.krew/tail.yaml
docker run --rm -v ./.krew/tail.yaml:/tmp/template-file.yaml ghcr.io/rajatjindal/krew-release-bot:latest krew-release-bot template --tag ${TAG} --template-file /tmp/template-file.yaml 1>/tmp/tail.yaml
go install sigs.k8s.io/krew/cmd/validate-krew-manifest@latest
~/go/bin/validate-krew-manifest -manifest /tmp/tail.yaml