mirror of
https://github.com/ahmetb/kubectx.git
synced 2026-03-16 19:02:14 +00:00
34 lines
987 B
YAML
34 lines
987 B
YAML
name: Go implementation (CI)
|
|
on:
|
|
push:
|
|
pull_request:
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.14
|
|
- name: Ensure gofmt
|
|
run: test -z "$(gofmt -s -d .)"
|
|
- name: Ensure go.mod is already tidied
|
|
run: go mod tidy && git diff --no-patch --exit-code
|
|
- name: Run unit tests
|
|
run: go test ./...
|
|
- name: Build with Goreleaser
|
|
uses: goreleaser/goreleaser-action@v1
|
|
with:
|
|
version: latest
|
|
args: release --snapshot --skip-publish --rm-dist
|
|
- name: Setup BATS framework
|
|
uses: mig4/setup-bats@master
|
|
with:
|
|
bats-version: 1.1.0
|
|
- name: kubectx (Go) integration tests
|
|
run: COMMAND=./dist/kubectx_linux_amd64/kubectx bats test/kubectx.bats
|
|
- name: kubens (Go) integration tests
|
|
run: COMMAND=./dist/kubens_linux_amd64/kubens bats test/kubens.bats
|