mirror of
https://github.com/ivuorinen/go-test-sarif.git
synced 2026-01-26 11:14:00 +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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- 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@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11
|
|
with:
|
|
sarif_file: go-test-results.sarif
|