From 5a63112f5356b4f5de2bc7d59c761dedb26bc15f Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 16 Mar 2020 18:43:48 +0300 Subject: [PATCH] ci cache modules --- .github/workflows/go.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 77b6a5e..e74d31a 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