Skip to content

Comprehensive library improvements #35

Comprehensive library improvements

Comprehensive library improvements #35

Workflow file for this run

name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
permissions:
contents: read
jobs:
build:
name: Lint ${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.24"]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@v4
- name: go vet
run: go vet ./...
- name: go fmt
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not formatted:"
gofmt -d .
exit 1
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
test:
name: Test Go ${{ matrix.go-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: ["1.24"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
run: go test -v -race ./...
- name: Run tests with coverage (Linux only)
if: matrix.os == 'ubuntu-latest'
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
files: ./coverage.out
flags: unittests
fail_ci_if_error: false
security:
name: Security Scan
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
scan-ref: "."
format: "sarif"
output: "trivy-results.sarif"
- name: Upload Trivy results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"