Skip to content

chore(deps): bump github/codeql-action from 3 to 4 in the actions group #70

chore(deps): bump github/codeql-action from 3 to 4 in the actions group

chore(deps): bump github/codeql-action from 3 to 4 in the actions group #70

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: latest
args: --timeout=5m0s
- run: go vet ./...
test:
needs: lint
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Run tests with race detector
shell: bash
run: go test -race -coverprofile=coverage.txt ./...
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: matrix.os == 'ubuntu-latest'
with:
name: coverage
path: coverage.txt
if-no-files-found: error
build:
needs: test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Build relay binary
shell: bash
run: |
mkdir -p dist
go build -trimpath -ldflags "-s -w \
-X main.cliVersion=0.4.0 \
-X main.gitCommit=${GITHUB_SHA} \
-X main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o dist/laststate-relay ./cmd/laststate-relay
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: relay-binary
path: dist/laststate-relay
if-no-files-found: error
security:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install govulncheck
shell: bash
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
shell: bash
run: govulncheck ./...
- name: Install Trivy
uses: aquasecurity/trivy-action@master
with:
scan-type: filesystem
security-checks: vuln
format: table
severity: CRITICAL,HIGH
exit-code: 1
sbom:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install syft
shell: bash
run: |
curl -sSfL https://github.com/anchore/syft/releases/download/v1.18.0/syft_1.18.0_linux_amd64.tar.gz | tar xz -C /usr/local/bin syft
- name: Generate SPDX SBOM
shell: bash
run: syft dir:. --quiet --output spdx-json=sbom.spdx.json
- name: Generate CycloneDX SBOM
shell: bash
run: syft dir:. --quiet --output cyclonedx-json=sbom.cdx.json
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sbom
path: |
sbom.spdx.json
sbom.cdx.json
if-no-files-found: error
upload-artifact:
needs: [build, sbom]
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event_name == 'pull_request'
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/download-artifact@v8
with:
pattern: relay-binary
path: dist/
merge-multiple: true
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: relay-binary
path: dist/laststate-relay
if-no-files-found: error