Skip to content

package analysis

package analysis #42

Workflow file for this run

name: Build, Test and Lint
on:
push:
pull_request:
workflow_dispatch:
jobs:
sbom:
permissions:
actions: read
contents: write
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: create cyclonedx sbom
uses: anchore/sbom-action@v0
with:
config: config/syft.yaml
format: cyclonedx-json
artifact-name: glvd2-sbom-cyclonedx-${{ github.sha }}.json
- name: create spdx sbom
uses: anchore/sbom-action@v0
with:
config: config/syft.yaml
format: spdx-json
artifact-name: glvd2-sbom-spdx-${{ github.sha }}.json
build-and-test:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: setup go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Download dependencies
run: go mod download
- name: Build
run: go build cmd/glvd2/main.go
- name: Test
run: go test -v ./...
lint:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: setup go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: "v2.12.2"
args: --timeout=5m --config=.golangci.yaml