Skip to content

fix: replace gokart with staticcheck #1373

fix: replace gokart with staticcheck

fix: replace gokart with staticcheck #1373

Workflow file for this run

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
name: release
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Format Unix
run: test -z $(go fmt ./...)
- name: Install GoKart
run: go install github.com/praetorian-inc/gokart@latest
- name: Static Analysis
uses: testifysec/witness-run-action@bdd82729b316d071606007cc9eecae326429caaf
with:
step: static-analysis
attestations: "github sarif"
command: staticcheck -f sarif ./... > sarif-results.json
- name: Test
uses: testifysec/witness-run-action@bdd82729b316d071606007cc9eecae326429caaf
with:
step: "test"
attestations: "github"
command: go test -v -coverprofile=profile.cov -covermode=atomic ./...
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
release:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.20.x
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download GoReleaser
run: go install github.com/goreleaser/goreleaser@latest
- name: Run GoReleaser
uses: testifysec/witness-run-action@bdd82729b316d071606007cc9eecae326429caaf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
with:
step: "build"
attestations: "github sbom"
command: goreleaser release --rm-dist