mirror of
https://github.com/ivuorinen/go-test-sarif.git
synced 2026-01-26 03:04:09 +00:00
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
---
|
|
name: Run Go Tests and Generate SARIF
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
with:
|
|
go-version-file: "go.mod"
|
|
|
|
- name: Install golangci-lint
|
|
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
|
with:
|
|
version: latest
|
|
|
|
- name: Run Linters
|
|
run: |
|
|
go vet ./...
|
|
golangci-lint run
|
|
- name: Run Go Tests
|
|
shell: bash
|
|
run: go test -json ./... > go-test-results.json
|
|
|
|
- name: Convert JSON to SARIF
|
|
run: go run ./cmd/main.go go-test-results.json go-test-results.sarif
|
|
|
|
- name: Upload SARIF to GitHub Security Tab
|
|
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
|
|
with:
|
|
sarif_file: go-test-results.sarif
|