Skip to content

chore(deps): update streetsidesoftware/cspell-action digest to 2db9e5f #338

chore(deps): update streetsidesoftware/cspell-action digest to 2db9e5f

chore(deps): update streetsidesoftware/cspell-action digest to 2db9e5f #338

Workflow file for this run

name: Continious integration
on:
pull_request:
branches:
- main
jobs:
tests:
name: Run tests and upload results
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.21", "1.22"]
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
# This is currently workaround for checking if gofiles have changed,
# Because paths filter doesn't work with required checks
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@6b2903bdce6310cfbddd87c418f253cf29b2dec9 # v44
with:
files: |
cmd/**
internal/**
.golangci.yml
go.mod
go.sum
- name: Setup Go
if: steps.changed-files.outputs.any_modified == 'true'
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: ${{ matrix.go-version }}
- name: golangci-lint
if: steps.changed-files.outputs.any_modified == 'true'
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6
with:
version: latest
args: --timeout=5m
- name: Install dependencies
if: steps.changed-files.outputs.any_modified == 'true'
run: go mod download
- name: Test with Go
if: steps.changed-files.outputs.any_modified == 'true'
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage reports to Codecov
if: steps.changed-files.outputs.any_modified == 'true'
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: cover.txt
slug: bl4ko/netbox-ssot
vulnerabilities:
name: Check for vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@6b2903bdce6310cfbddd87c418f253cf29b2dec9 # v44
with:
files: |
cmd/**
internal/**
.golangci.yml
go.mod
go.sum
.dockerignore
Dockerfile
# https://github.com/aquasecurity/trivy-action?tab=readme-ov-file#scan-ci-pipeline
- name: Build an image from Dockerfile
if: steps.changed-files.outputs.any_modified == 'true'
run: |
docker build -t netbox-ssot:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
if: steps.changed-files.outputs.any_modified == 'true'
uses: aquasecurity/trivy-action@master
with:
image-ref: netbox-ssot:${{ github.sha }}
format: table
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'