diff --git a/.github/workflows/eoefans-api-docker-ci.yml b/.github/workflows/eoefans-api-docker-ci.yml index fdd1331..a2b15a2 100644 --- a/.github/workflows/eoefans-api-docker-ci.yml +++ b/.github/workflows/eoefans-api-docker-ci.yml @@ -36,11 +36,32 @@ jobs: ls config cat config/version - - uses: actions/setup-go@v4 + - uses: actions/setup-go@main with: go-version: '^1.18' + cache-dependency-path: ./go.sum + cache: true - run: go version + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + + # Cache go build cache, used to speedup go test + - name: Go Build Cache + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + + # Cache go mod cache, used to speedup builds + - name: Go Mod Cache + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + - name: go dependencies run: go mod download diff --git a/.github/workflows/eoefans-spider-docker-ci.yml b/.github/workflows/eoefans-spider-docker-ci.yml index 9c8529a..2f4e6e0 100644 --- a/.github/workflows/eoefans-spider-docker-ci.yml +++ b/.github/workflows/eoefans-spider-docker-ci.yml @@ -35,11 +35,32 @@ jobs: ls config cat config/version - - uses: actions/setup-go@v4 + - uses: actions/setup-go@main with: go-version: '^1.18' + cache-dependency-path: ./go.sum + cache: true - run: go version + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + + # Cache go build cache, used to speedup go test + - name: Go Build Cache + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + + # Cache go mod cache, used to speedup builds + - name: Go Mod Cache + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + - name: go dependencies run: go mod download