Skip to content

Commit

Permalink
Update Github test actions (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixik committed Feb 23, 2024
1 parent 1eab316 commit 5b9c2ce
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,37 @@ jobs:
matrix:
go-version: [1.18.x, 1.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: WillAbides/setup-go-faster@v1
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4

- uses: actions/cache@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
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-
go-version: ${{ matrix.go-version }}

- name: Test with race and coverage
run: |
go test -race -coverprofile=coverage.out -covermode=atomic
go tool cover -func=coverage.out
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
files: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }} # required

lint:
name: "Run static analysis"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: WillAbides/setup-go-faster@v1
- uses: actions/checkout@v4

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: "1.x"

- run: "go vet ./..."

- uses: dominikh/staticcheck-action@v1
- name: Staticcheck
uses: dominikh/[email protected]
with:
version: "2022.1.3"
install-go: false

0 comments on commit 5b9c2ce

Please sign in to comment.