Skip to content

Update dependabot.yml #766

Update dependabot.yml

Update dependabot.yml #766

Workflow file for this run

name: Go-static-analysis
on: [push, pull_request]
permissions:
contents: read
jobs:
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.3
- name: remove deployer container from dockerfile
run: sed -ie '/End of builder/,+5d' ./docker/userspacecni/Dockerfile
- name: Build the Docker image
run: docker build . -f ./docker/userspacecni/Dockerfile -t userspacecni:latest
- name: run container
run: docker run --name userspacecni -itd userspacecni:latest bash
- name: docker copy generated bin api files
run: docker cp userspacecni:/root/userspace-cni-network-plugin/cnivpp ./
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.52.2
args: --timeout=20m
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # master
hadolint:
runs-on: ubuntu-latest
name: Hadolint
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
name: Run Hadolint
with:
dockerfile: ./docker/userspacecni/Dockerfile
ignore: DL3008,DL3059
go-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- name: remove deployer container from dockerfile
run: sed -ie '/End of builder/,+5d' ./docker/userspacecni/Dockerfile
- name: Build the Docker image
run: docker build . -f ./docker/userspacecni/Dockerfile -t userspacecni:latest
- name: run container
run: docker run --name userspacecni -itd userspacecni:latest bash
- name: docker copy generated bin api files
run: docker cp userspacecni:/root/userspace-cni-network-plugin/cnivpp ./
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.1
- name: Checkout dockerfile to avoid false diff
run: git checkout ./docker/userspacecni/Dockerfile
# if this fails, run go mod tidy
- name: Tidy
run: go mod tidy
- name: Check if module files are consistent with code
run: git diff --exit-code
# if this fails, run go mod vendor
- name: Check if vendor directory is consistent with go modules
run: go mod vendor && git diff --exit-code