fix: multi-platform build #11531
Workflow file for this run
This file contains hidden or 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: Checks | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
workflow_dispatch: | |
env: | |
GO_VERSION: "~1.24.0" | |
jobs: | |
lint: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, ubuntu-22.04-arm] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
check-latest: true | |
cache-dependency-path: "**/go.sum" | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Module cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
env: | |
cache-name: go-mod-cache | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} | |
- name: Tools cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
env: | |
cache-name: go-tools-cache | |
with: | |
path: ~/.tools | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev | |
- name: Run linters | |
run: make license-header-check go-mod-tidy golangci-lint | |
- name: Check clean repository | |
run: make check-clean-work-tree | |
race-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
check-latest: true | |
cache-dependency-path: "**/go.sum" | |
- name: Install build dependencies | |
run: sudo apt-get update && sudo apt-get install -y clang llvm | |
- name: Run tests | |
run: make test-race | |
detect-integration-tests: | |
runs-on: ubuntu-latest | |
outputs: | |
tests: ${{ steps.set-tests.outputs.tests }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- id: set-tests | |
run: | | |
tests=$( \ | |
find ./internal/test/e2e -depth -maxdepth 1 -mindepth 1 -type d -exec basename {} \; \ | |
| jq -R -s -c 'split("\n")[:-1]' \ | |
) | |
echo "tests=$tests" | |
echo "tests=$tests" >> $GITHUB_OUTPUT | |
integration-test: | |
needs: detect-integration-tests | |
strategy: | |
matrix: | |
test: ${{ fromJSON(needs.detect-integration-tests.outputs.tests) }} | |
runner: [ubuntu-latest, ubuntu-22.04-arm] | |
runs-on: ${{ matrix.runner }} | |
container: | |
image: golang:1.24.3-bookworm@sha256:29d97266c1d341b7424e2f5085440b74654ae0b61ecdba206bc12d6264844e21 | |
options: --user root --privileged | |
steps: | |
- id: go-cache-paths | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Go Build Cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ runner.os }}-${{ matrix.test}}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Go Mod Cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-${{ matrix.test}}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Install dependencies | |
run: apt-get update && apt-get install -y sudo clang llvm | |
- name: Initialize | |
run: make go-mod-tidy generate | |
- name: Test ${{ matrix.test }} | |
shell: bash | |
env: | |
TEST: ${{ matrix.test }} | |
run: | | |
# Create a temp file to store the JSON output | |
tmpfile=$(mktemp) | |
cd "internal/test/e2e/$TEST" | |
# Stream test output to stdout and save to file for jq | |
go test -v -run='^TestIntegration' | tee "$tmpfile" | |
# Fail if any "skip" action occurs under TestIntegration/ | |
go tool test2json < "$tmpfile" | jq -e ' | |
select( | |
.Action == "skip" and | |
.Test == "TestIntegration" | |
)' >/dev/null && { | |
rm "$tmpfile" | |
echo "❌ TestIntegration was skipped!" | |
exit 1 | |
} | |
rm "$tmpfile" | |
compatibility-test: | |
strategy: | |
matrix: | |
go-version: ["stable", "oldstable"] | |
os: [ubuntu-latest, ubuntu-22.04-arm] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
check-latest: true | |
cache-dependency-path: "**/go.sum" | |
- name: Install build dependencies | |
run: sudo apt-get update && sudo apt-get install -y clang llvm | |
- name: Run tests | |
run: make test | |
- name: Run eBPF verification tests | |
run: sudo --preserve-env=PATH make test-ebpf | |
- name: Check repository unmodified | |
run: make check-clean-work-tree | |
verify-licenses: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
check-latest: true | |
cache-dependency-path: "**/go.sum" | |
- name: Install build dependencies | |
run: sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev | |
- run: make verify-licenses | |
docker-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Build auto-instrumentation | |
run: make docker-build | |
offsets: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
check-latest: true | |
cache-dependency-path: "**/go.sum" | |
- name: Update offsets | |
run: make offsets | |
- name: Check diff | |
run: make check-clean-work-tree |