diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 77b6a5e0..e74d31aa 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,5 +1,17 @@ name: Go -on: [push] +on: + push: + branches: + - master + - develop + paths-ignore: + - '*.md' + pull_request: + branches: + - master + - develop + paths-ignore: + - '*.md' jobs: test: @@ -14,9 +26,10 @@ jobs: uses: actions/setup-go@v1 with: go-version: ${{ matrix.go }} + id: go - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Set GOPATH # temporary fix @@ -26,6 +39,13 @@ jobs: echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin" shell: bash + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Get dependencies run: | go get -u -v golang.org/x/lint/golint