make: check if docker is using new oci save format #7184
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run static checks | |
on: | |
push: | |
branches: | |
- main | |
- v* | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
permissions: | |
# For golangci/golangci-lint to have read access to pull request for `only-new-issues` option. | |
contents: read | |
jobs: | |
golangci-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
# renovate: datasource=golang-version depName=go | |
go-version: '1.22.0' | |
# using golangci-lint cache instead | |
cache: false | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 | |
with: | |
# renovate: datasource=docker depName=docker.io/golangci/golangci-lint | |
version: v1.56.2 | |
args: --config=.golangci.yml --verbose | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
# renovate: datasource=golang-version depName=go | |
go-version: '1.22.0' | |
- name: Check gofmt formatting | |
run: | | |
go fmt ./... | |
git diff --exit-code || (echo "gofmt checks failed. Please run 'go -w fmt ./...', and submit your changes"; exit 1) | |
- name: Build clang-format Docker image | |
run: docker build -f Dockerfile.clang-format -t "isovalent/clang-format:latest" . | |
- name: Verify clang-format on BPF code | |
run: | | |
set -o pipefail | |
find bpf -name '*.c' -o -name '*.h' -not -path 'bpf/include/vmlinux.h' \ | |
-not -path 'bpf/include/api.h' -not -path 'bpf/libbpf/*' | xargs -n 1000 \ | |
docker run -v $(realpath .):/tetragon "isovalent/clang-format:latest" --Werror -n -style=file | |
if [ $? != 0 ]; then | |
echo "clang-format checks failed. Please run 'make format' and submit your changes."; exit 1 | |
fi | |
vendoring: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
# renovate: datasource=golang-version depName=go | |
go-version: '1.22.0' | |
- name: Check module vendoring | |
run: | | |
make vendor | |
echo "git status --porcelain:" `git status --porcelain` | |
test -z "$(git status --porcelain)" || (echo "Module vendoring checks failed. Please run 'make vendor', and submit your changes"; exit 1) | |
build-cli: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Build CLI release binaries | |
run: make cli-release |