Skip to content

Commit

Permalink
Fix go cache path per Github Action example, fix build for different …
Browse files Browse the repository at this point in the history
…go versions (#5331)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored May 10, 2022
1 parent b781f85 commit eee8ff7
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
Expand All @@ -53,8 +53,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: golint
run: make -j2 golint
Expand All @@ -80,8 +80,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: checklicense
run: make checklicense
Expand Down Expand Up @@ -133,14 +133,14 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Cache Build
uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
key: go-build-unittest-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
path: ~/.cache/go-build
key: unittest-${{ runner.os }}-go-build-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: make gotest
test-coverage:
Expand All @@ -162,14 +162,14 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Cache Build
uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
key: go-build-coverage-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
path: ~/.cache/go-build
key: coverage-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests With Coverage
run: make gotest-with-cover
- name: Upload coverage report
Expand Down Expand Up @@ -221,8 +221,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Build
env:
Expand Down

0 comments on commit eee8ff7

Please sign in to comment.