From 12502113816c4f2a718e6dfea8469c5ad07ec0c1 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 16 Jun 2020 23:33:27 +0200 Subject: [PATCH] github actions: try caching the module cache --- .github/workflows/go.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 .