-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* whitespace (trim and indentation) * step naming
- Loading branch information
1 parent
4303b6a
commit 61bbe53
Showing
1 changed file
with
73 additions
and
79 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,89 +1,83 @@ | ||
name: Kubernetes-sigs/krew CI | ||
on: | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*.*.*' | ||
branches: | ||
- "*" | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
branches: | ||
- '*' | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Add GOPATH/bin to PATH | ||
run: echo "::add-path::$(go env GOPATH)/bin" | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Install gox | ||
run: hack/install-gox.sh | ||
|
||
- name: Ensure go module is tidy | ||
run: go mod tidy && git diff --no-patch --exit-code | ||
|
||
- name: Verify code patterns | ||
run: hack/verify-code-patterns.sh | ||
|
||
- name: Verify boilerplate | ||
run: hack/verify-boilerplate.sh | ||
|
||
- name: Run code lint | ||
run: hack/run-lint.sh | ||
|
||
- name: Run unit tests | ||
run: go test -short -coverprofile=coverage.txt -covermode=atomic ./... | ||
|
||
- name: Make binaries && verify krew installation | ||
run: hack/make-all.sh | ||
|
||
- name: Ensure kubectl installed | ||
run: hack/ensure-kubectl-installed.sh | ||
|
||
- name: Verify installation | ||
run: hack/verify-installation.sh | ||
|
||
- name: Run integration tests | ||
run: hack/run-integration-tests.sh | ||
|
||
- name: Verify receipt migration from 0.2.x to 0.3.x | ||
run: hack/verify-receipts-upgrade-migration.sh | ||
|
||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Add GOPATH | ||
run: echo "::add-path::$(go env GOPATH)/bin" | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Install gox | ||
run: hack/install-gox.sh | ||
|
||
- name: Verify code quality | ||
run: go mod tidy && git diff --no-patch --exit-code | ||
|
||
- name: Verify code patterns | ||
run: hack/verify-code-patterns.sh | ||
|
||
- name: Verify boilerplate | ||
run: hack/verify-boilerplate.sh | ||
|
||
- name: Run code lint | ||
run: hack/run-lint.sh | ||
|
||
- name: Run unit tests | ||
run: go test -short -coverprofile=coverage.txt -covermode=atomic ./... | ||
|
||
- name: Make binaries && verify krew installation | ||
run: hack/make-all.sh | ||
|
||
- name: Ensure kubectl installed | ||
run: hack/ensure-kubectl-installed.sh | ||
|
||
- name: Verify installation | ||
run: hack/verify-installation.sh | ||
|
||
- name: Run integration tests | ||
run: hack/run-integration-tests.sh | ||
|
||
- name: Receipts upgrade migrations | ||
run: hack/verify-receipts-upgrade-migration.sh | ||
|
||
- name: Create release | ||
if: contains(github.ref, 'tags') | ||
id: create_release | ||
uses: actions/create-release@v1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload binaries to release | ||
if: contains(github.ref, 'tags') | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: out/krew.* | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true | ||
|
||
|
||
- name: Create a new release | ||
if: contains(github.ref, 'tags') | ||
id: create_release | ||
uses: actions/create-release@v1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload binaries to the new release | ||
if: contains(github.ref, 'tags') | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: out/krew.* | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true |