Skip to content

Commit

Permalink
🌱 Verify clean env in build
Browse files Browse the repository at this point in the history
- Verify go mod tidy and go mod verify
- Verify git porcelain
  • Loading branch information
naveensrinivasan committed Feb 15, 2022
1 parent 322c6e0 commit 4e72ea3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/tests.yaml
Expand Up @@ -38,3 +38,36 @@ jobs:
- name: Run Go tests
# cannot run tests with race because we are mutating state (setting ENV variables)
run: go test ./...

verify:
name: Run verify
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #v2.4.0
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #v2.1.7
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 #v2.1.5
with:
go-version: '1.17.x'
- name: Run Go verify
run: |
go mod tidy && go mod verify
git diff --exit-code

0 comments on commit 4e72ea3

Please sign in to comment.