Skip to content

fix(grpc/exec): fix RefDec in exit's eventcache path #15623

fix(grpc/exec): fix RefDec in exit's eventcache path

fix(grpc/exec): fix RefDec in exit's eventcache path #15623

Workflow file for this run

# This workflow runs various sanity checks across the codebase. Specific
# components, like APIs, are also validated by dedicated workflows.
name: Run static checks
on:
push:
branches:
- main
- v*
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
# Until https://github.com/orgs/community/discussions/44490
# is not resolved, run on all paths, even "**.md".
permissions:
# For golangci/golangci-lint to have read access to pull request for `only-new-issues` option.
contents: read
jobs:
build-every-commit:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.25.6'
- name: Check if build works for every commit
run: |
set -x
PR_FIRST_COMMIT=$(git rev-list --reverse origin/${{ github.event.pull_request.base.ref }}..HEAD | head -1)
git rebase --exec "make -j$(nproc) tetragon tetra tetragon-bpf tetragon-operator" $PR_FIRST_COMMIT^
- name: Failed commit during the build
if: ${{ failure() }}
run: git --no-pager log --format=%B -n 1
ensure-no-binary-checkin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Ensure No Binary Files Checked In
run: |
echo "Checking for any checked in binary files not in allowlist..."
outfile="$(mktemp)"
find . -type f -size +0 -not -wholename '**/vendor/**' -not -wholename '**/_vendor/**' -not -wholename '**/.git/**' -not -name '*.png' -not -name '*.jpg' -not -name '*.ico' | xargs -n 100 grep -IL '' | tee "$outfile"
test -z "$(cat $outfile)"
golangci-lint:
strategy:
matrix:
os: [linux, windows]
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.25.6'
# using golangci-lint cache instead
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
env:
GOOS: ${{ matrix.os }}
with:
# renovate: datasource=docker depName=docker.io/golangci/golangci-lint
version: v2.8.0
args: --config=.golangci.yml --verbose
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.25.6'
- 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' | 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.25.6'
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build CLI release binaries
run: make cli-release
build-windows:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build tetragon Windows binaries
run: |
GOOS=windows GOARCH=amd64 make tetragon
GOOS=windows GOARCH=arm64 make tetragon
errmetrics-fileids-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check errmetrics file IDs are in sync
run: ./contrib/fileids-check.sh