-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change Go action to build and add cache * Add dependency download step * Rearrange steps * Remove docker build * Change build tag * Enable Build on pull_request * Add linter checking * Add linter cache * Correct spelling * Change lint cache path * Cache go/bin instead * Add go bin to path * Correct command syntax * Test linter * Change cache step id * Change cache search pattern * Remove linter cache
- Loading branch information
1 parent
310b336
commit 90ae17f
Showing
4 changed files
with
31 additions
and
34 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 |
---|---|---|
@@ -1,27 +1,36 @@ | ||
name: Go | ||
on: [push] | ||
name: Build | ||
on: [push, pull_request] | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
- name: Cache (dependencies) | ||
uses: actions/cache@v1 | ||
id: cache | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install linter | ||
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2" | ||
|
||
- name: Build, run tests and vet | ||
run: | | ||
go build | ||
go test | ||
go vet | ||
env: | ||
GO111MODULE: "on" | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: go mod download | ||
|
||
- name: Lint | ||
run: | | ||
export PATH=$PATH:~/go/bin | ||
./run_tests.sh lint |
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
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 |
---|---|---|
|
@@ -35,5 +35,3 @@ elif [[ "$option" = "all" ]]; then | |
else | ||
echo "Usage: ./run_tests.sh [all | build | lint]" | ||
fi | ||
|
||
|