Skip to content

Commit

Permalink
github actions: try caching the module cache
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed Jun 16, 2020
1 parent 9c7e626 commit 1250211
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/...
Expand All @@ -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 .
Expand Down

0 comments on commit 1250211

Please sign in to comment.