mirror of
https://github.com/ivuorinen/go-test-sarif.git
synced 2026-02-02 00:44:14 +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>
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
---
|
|
name: Run Go Tests and Generate SARIF
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
|
with:
|
|
go-version-file: "go.mod"
|
|
|
|
- name: Install golangci-lint
|
|
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.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@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
|
|
with:
|
|
sarif_file: go-test-results.sarif
|