ci: improve build timings and skips #167
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: [push] | |
jobs: | |
unittests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 8 | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
cache-dependency-path: "**/*.sum" | |
- uses: actions/checkout@v3 | |
- uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
**/**.go | |
**/**.sum | |
**/go.mod | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: go-test-${{ github.sha }} | |
restore-keys: | | |
go-test- | |
if: env.GIT_DIFF | |
- name: grip tests | |
run: go test -race ./... | |
if: env.GIT_DIFF | |
lint: | |
name: golangci-lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
cache-dependency-path: "**/*.sum" | |
- uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
**/**.go | |
**/**.sum | |
**/go.mod | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: go-test-${{ github.sha }} | |
restore-keys: | | |
go-test- | |
if: env.GIT_DIFF | |
- uses: golangci/golangci-lint-action@v3 | |
with: | |
# Required: the version of golangci-lint is required and | |
# must be specified with patch version: we always use the | |
# latest patch version. | |
version: v1.51.2 | |
args: --timeout 5m | |
github-token: ${{ secrets.github_token }} | |
if: env.GIT_DIFF |