Skip to content

Commit

Permalink
ci: build tetragon on every commit of a PR
Browse files Browse the repository at this point in the history
Authors can often lose track when rebasing large PR and submit a PR
containing commits that don't compile. It can then make it harder to
bisect regressions. This workflow should ensure that at least each
commits build.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
  • Loading branch information
mtardy committed Jan 30, 2025
1 parent db01c3d commit 79a7ae7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@ permissions:
contents: read

jobs:
build-every-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.23.5'

- name: Check if build works for every commit
run: |
set -x
PR_FIRST_COMMIT=$(git rev-list --reverse -1 origin/${{ github.event.pull_request.base.ref }}..HEAD)
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:
Expand Down

0 comments on commit 79a7ae7

Please sign in to comment.