diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0ec6246..6a57712 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,6 +23,14 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 + - name: Share cache with other actions + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Ensure all files were formatted as per gofmt run: | gofmt -l $(find . -name '*.go') >/dev/null @@ -50,6 +58,14 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 + - name: Share cache with other actions + 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 -v -race ./internal/... @@ -69,6 +85,14 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 + - name: Share cache with other actions + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Build Docker container with the tools our tests require run: | docker build --pull --no-cache --rm -t=router7 -f travis/Dockerfile .