diff --git a/.github/workflows/01-default.yml b/.github/workflows/01-default.yml new file mode 100644 index 0000000..acaff83 --- /dev/null +++ b/.github/workflows/01-default.yml @@ -0,0 +1,61 @@ +name: Default Workflow + +on: + push: + branches: + - '*' + tags: + - '**' + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + go_version: [1.16, 1.17, 1.18] + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go_version }} + install-go: true + + - name: Cache Go Modules + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: go-${{ matrix.go_version }}-${{ runner.os }} + + - name: Check Go version + run: go version + + - name: Go mod vendor + run: go mod vendor + - name: Git diff check + run: git diff --exit-code + + - name: Build and Test + run: | + make build + make test + make test-integration + + - name: Check License and Generate + run: | + make check-license + make generate + git diff --exit-code + + - name: Cleanup + run: go clean -modcache + + - name: Post Cleanup + run: go clean -cache \ No newline at end of file diff --git a/Makefile b/Makefile index 67b7d9f..0a26c5d 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ SHELL=/bin/bash GITHUB_URL=github.com/jsonnet-bundler/jsonnet-bundler VERSION := $(shell git describe --tags --dirty --always) +GOPATH=$(HOME)/go OUT_DIR=_output BIN?=jb PKGS=$(shell go list ./... | grep -v /vendor/)