mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-02 05:08:42 -07:00
ci: add staticcheck lint job and Go version matrix for unit tests
This commit is contained in:
24
.github/workflows/integration.yml
vendored
24
.github/workflows/integration.yml
vendored
@@ -6,18 +6,34 @@ on:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Unit Tests
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go build ./...
|
||||
- name: Install staticcheck
|
||||
run: go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
- run: go vet ./...
|
||||
- run: staticcheck ./...
|
||||
|
||||
unit-tests:
|
||||
name: Unit Tests (Go ${{ matrix.go-version }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: ['1.25', '1.26']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- run: go build ./...
|
||||
- run: go test -race -coverprofile=coverage-unit.out ./...
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: matrix.go-version == '1.26'
|
||||
with:
|
||||
name: coverage-unit
|
||||
path: coverage-unit.out
|
||||
@@ -174,7 +190,7 @@ jobs:
|
||||
codecov:
|
||||
name: Upload Coverage
|
||||
runs-on: ubuntu-latest
|
||||
needs: [unit-tests, debian, ubuntu, fedora-dnf4, fedora-dnf5, alpine, arch, flatpak]
|
||||
needs: [lint, unit-tests, debian, ubuntu, fedora-dnf4, fedora-dnf5, alpine, arch, flatpak]
|
||||
if: always()
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user