Skip to content

Commit

Permalink
chore: added release and presubmit actions (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellistarn authored Oct 12, 2022
1 parent 9f28ba0 commit 01f7a20
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Presubmit
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
presubmit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sed -En 's/^go[[:space:]]+([[:digit:].]+)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
~/.kubebuilder/bin
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
- run: make presubmit
- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
13 changes: 13 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release
on:
push:
tags: ['v*.*.*']

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

ci: verify test ## Run all steps used by continuous integration
presubmit: verify test ## Run all steps required for code to be checked in

test: ## Run tests
go test -run=${TEST_FILTER} ./...
go test -run=${TEST_FILTER} ./... \
-race \
-cover -coverprofile=coverage.out -outputdir=. -coverpkg=./...

verify: codegen ## Verify code. Includes dependencies, linting, formatting, etc
go mod tidy
Expand All @@ -23,4 +25,4 @@ codegen: ## Generate code. Must be run if changes are made to ./pkg/apis/...
output:crd:artifacts:config=chart/crds
hack/boilerplate.sh

.PHONY: help ci test verify codegen
.PHONY: help presubmit test verify codegen

0 comments on commit 01f7a20

Please sign in to comment.