Skip to content

Commit

Permalink
Merge pull request openshift#3 from timflannagan/add-gh-actions
Browse files Browse the repository at this point in the history
Introduce a sanity github action check
  • Loading branch information
timflannagan committed Jul 27, 2021
2 parents 91813bb + c2f9499 commit eec5919
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: sanity

on:
push:
branches:
- '**'
pull_request:
paths:
- '**'

jobs:
sanity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '~1.16'
- name: Run verification checks
run: make verify
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@

# Dependency directories
vendor/
bin/
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tidy: ## Update dependencies
$(Q)go mod tidy -v

vendor: tidy ## Update vendor directory
$(Q)go mod vendor
$(Q)go mod vendor

generate: controller-gen ## Generate code
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./...
Expand All @@ -49,12 +49,11 @@ test: test-unit ## Run the tests
test-unit: ## Run the unit tests
$(Q)go test -count=1 -short ${PKGS}

verify: manifests generate
verify: tidy format manifests generate
git diff --exit-code

# Utilities.
.PHONY: controller-gen

controller-gen: vendor ## Find or download controller-gen
controller-gen: vendor ## Find or download controller-gen
CONTROLLER_GEN=$(Q)go run -mod=vendor ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen

0 comments on commit eec5919

Please sign in to comment.