-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace travis job with github action. (#66)
* Replace travis job with github action. * Add action rule in Makefile to perform the same steps as github action. Github actions also run on pull_request. Add help option to Makefile. * Add missing regenerate step.
- Loading branch information
Showing
6 changed files
with
136 additions
and
26 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
working-directory: ./src/github.com/awalterschulze/gographviz | ||
|
||
steps: | ||
- name: Set GOPATH | ||
run: | | ||
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)/gographviz" | ||
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/gographviz/bin" | ||
shell: bash | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.14' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
path: src/github.com/awalterschulze/gographviz | ||
|
||
- name: Install dependencies | ||
run: make dependencies | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Run regenerate | ||
run: make regenerate | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Run build | ||
run: make build | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Run checkers | ||
run: make checkers | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Run testing | ||
run: make test | ||
working-directory: ${{env.working-directory}} |
This file was deleted.
Oops, something went wrong.
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,16 +1,35 @@ | ||
regenerate: | ||
.PHONY: help regenerate test dependencies build checkers action | ||
|
||
# Prefer tools that we've installed | ||
export PATH := $(HOME)/go/bin:$(PATH) | ||
|
||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
regenerate: ## Re-generate lexers and parsers and pass through goimports | ||
go get github.com/goccmack/gocc | ||
go install github.com/goccmack/gocc | ||
gocc -zip -o ./internal/ dot.bnf | ||
gocc -zip -o ./internal/ dot.bnf | ||
find . -type f -name '*.go' | xargs goimports -w | ||
go mod tidy | ||
|
||
test: | ||
test: ## Perform package tests | ||
go test ./... | ||
|
||
travis: | ||
make regenerate | ||
go build ./... | ||
go test ./... | ||
dependencies: ## Grab necessary dependencies for checkers | ||
go version | ||
go get golang.org/x/tools/cmd/goimports | ||
go get github.com/kisielk/errcheck | ||
go get -u golang.org/x/lint/golint | ||
go mod tidy | ||
|
||
build: ## Perform build process | ||
go build . | ||
|
||
checkers: ## Run all checkers (errcheck, gofmt and golint) | ||
errcheck -ignore 'fmt:[FS]?[Pp]rint*' ./... | ||
gofmt -l -s -w . | ||
golint -set_exit_status | ||
git diff --exit-code | ||
|
||
action: dependencies regenerate build test checkers ## Run steps of github action |
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
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.