From c974908e19f9c05bf2c338f8528a39f117b537b6 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Mon, 31 Aug 2020 01:10:28 +0800 Subject: [PATCH] Test: refine & cache Go modules --- .github/workflows/test.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b21ef209..cc6f06177 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,7 @@ on: - "**/*.go" pull_request: branches: [master] + types: [opened, synchronize, reopened] paths: - "**/*.go" @@ -22,12 +23,15 @@ jobs: with: go-version: ^1.14 - - name: Checkout default branch + - name: Checkout codebase uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... + - name: Cache go module + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - name: Test - run: go test -parallel 1 -timeout 6h -v ./... + run: go test -timeout 1h -v ./...