Skip to content

Commit

Permalink
fail on error (nektos#20)
Browse files Browse the repository at this point in the history
ci-via-github-actions
  • Loading branch information
cplee authored Jan 23, 2019
1 parent f98caa2 commit 320e9b6
Show file tree
Hide file tree
Showing 1,274 changed files with 398,630 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/actions/check/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM golangci/golangci-lint:v1.12.5

LABEL "com.github.actions.name"="Check"
LABEL "com.github.actions.description"="Run static analysis and unit tests"
LABEL "com.github.actions.icon"="check-circle"
LABEL "com.github.actions.color"="green"

COPY "entrypoint.sh" "/entrypoint.sh"
RUN chmod +x /entrypoint.sh

ENV GOFLAGS -mod=vendor
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion .github/actions/check/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

set -e
golangci-lint run
go test -cover ./...
10 changes: 8 additions & 2 deletions .github/main.workflow
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ action "check" {
uses = "./.github/actions/check"
}

action "branch-filter" {
action "release-filter" {
needs = ["check"]
uses = "actions/bin/filter@master"
args = "tag v*"
}

# only release on `v*` tags
action "release" {
needs = ["branch-filter"]
needs = ["release-filter"]
uses = "docker://goreleaser/goreleaser:v0.98"
args = "release"
secrets = ["GITHUB_TOKEN"]
Expand All @@ -27,3 +27,9 @@ action "build" {
args = "--snapshot --rm-dist"
secrets = ["SNAPSHOT_VERSION"]
}

# local action for `make vendor`
action "vendor" {
uses = "docker://golang:1.11.4"
args = "go mod vendor"
}
4 changes: 1 addition & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
- GOFLAGS=-mod=vendor
goos:
- darwin
- linux
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif
IS_SNAPSHOT = $(if $(findstring -, $(VERSION)),true,false)
TAG_VERSION = v$(VERSION)

ACT ?= go run main.go
ACT ?= go run -mod=vendor main.go

default: check

Expand All @@ -35,7 +35,7 @@ installer:
@GO111MODULE=off go get github.com/goreleaser/godownloader
godownloader -r nektos/act -o install.sh

promote:
promote: vendor
@echo "VERSION:$(VERSION) IS_SNAPSHOT:$(IS_SNAPSHOT) LATEST_VERSION:$(LATEST_VERSION)"
ifeq (false,$(IS_SNAPSHOT))
@echo "Unable to promote a non-snapshot"
Expand All @@ -47,4 +47,9 @@ ifneq ($(shell git status -s),)
endif
$(eval NEW_VERSION := $(word 1,$(subst -, , $(TAG_VERSION))))
git tag -a -m "releasing $(NEW_VERSION)" $(NEW_VERSION)
git push origin $(NEW_VERSION)
git push origin $(NEW_VERSION)

vendor:
go run main.go -ra vendor

.PHONY: vendor
1 change: 1 addition & 0 deletions vendor/github.com/Microsoft/go-winio/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions vendor/github.com/Microsoft/go-winio/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions vendor/github.com/Microsoft/go-winio/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 320e9b6

Please sign in to comment.