-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add conftest to build bump client-go v0.23.3 fix release ver in docs add test, fix workflow update workflow name, quiet wget add orderedmap to go.mod add proper test fix test again test fix proper failing test fixes #11 run tests on k8s with api changes + goreleaser workflow run tests on k8s with api changes export gopath for test runs manually delete kind cluster manually delete kind cluster use separate kind cluster names increase verbosity use master for kind action try forking revert kind changes
- Loading branch information
1 parent
cee6b34
commit 7b35841
Showing
8 changed files
with
584 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
name: Go | ||
on: [push] | ||
name: Go & K8s build | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.13 | ||
- name: Set up Go 1.17.6 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
go-version: 1.17.6 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get dependencies & install | ||
run: | | ||
go get -v -t -d ./... | ||
|
@@ -23,13 +22,15 @@ jobs: | |
dep ensure | ||
fi | ||
go install -v . | ||
- uses: engineerd/[email protected] | ||
curl -fsSLO https://github.com/open-policy-agent/conftest/releases/download/v0.30.0/conftest_0.30.0_Linux_x86_64.tar.gz | ||
tar -C /usr/local/bin -xzvf conftest_0.30.0_Linux_x86_64.tar.gz | ||
wget -q https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz | ||
tar xf kubeval-linux-amd64.tar.gz | ||
sudo cp kubeval /usr/local/bin | ||
- name: Setup kind | ||
uses: engineerd/[email protected] | ||
- name: Run Kubernetes tests | ||
run: | | ||
kubectl cluster-info | ||
wget -q --show-progress https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz | ||
tar xf kubeval-linux-amd64.tar.gz | ||
sudo cp kubeval /usr/local/bin | ||
export PATH="$(go env GOPATH)/bin:$PATH" | ||
export PATH="$(go env GOPATH)/bin:$PATH" | ||
tests/k8s.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.6 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
deny[msg] { | ||
input.rules[i].apiGroups[_] == "batch" | ||
not valid_batch(input.rules[i].resources) | ||
msg := "Must contain all batch resources" | ||
} | ||
|
||
valid_batch(resources) { | ||
startswith(resources[_], "cronjobs") | ||
startswith(resources[_], "jobs") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters