Prepare for release v1.16.0-pre.3 #1128
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: Build Commits | |
# Any change in triggers needs to be reflected in the concurrency group. | |
on: | |
pull_request: {} | |
permissions: read-all | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
build_commits: | |
name: Check if build works for every commit | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 180 | |
steps: | |
- name: Collect Workflow Telemetry | |
uses: catchpoint/workflow-telemetry-action@94c3c3d9567a0205de6da68a76c428ce4e769af1 # v2.0.0 | |
with: | |
comment_on_pr: false | |
- name: Configure git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "github-actions@users.noreply.github.com" | |
- name: Install Go | |
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | |
with: | |
# renovate: datasource=golang-version depName=go | |
go-version: 1.22.4 | |
- name: Checkout code | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
persist-credentials: false | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Check if build works for every commit | |
run: | | |
set -eu -o pipefail | |
COMMITS=$(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) | |
for commit in $COMMITS ; do | |
git checkout $commit || exit 1 | |
contrib/scripts/builder.sh make build -j $(nproc) || exit 1 | |
done | |
- name: Check bpf code changes | |
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: bpf-tree | |
with: | |
filters: | | |
src: | |
- 'bpf/**' | |
# Runs only if code under bpf/ is changed. | |
- name: Check if datapath build works for every commit | |
if: steps.bpf-tree.outputs.src == 'true' | |
run: | | |
set -eu -o pipefail | |
COMMITS=$(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) | |
for commit in $COMMITS ; do | |
git checkout $commit || exit 1 | |
contrib/scripts/builder.sh make -C bpf build_all -j $(nproc) || exit 1 | |
done | |
- name: Check test code changes | |
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
id: test-tree | |
with: | |
filters: | | |
src: | |
- 'pkg/**' | |
- 'test/**' | |
- name: Set clang directory | |
if: steps.test-tree.outputs.src == 'true' | |
id: set_clang_dir | |
run: echo "clang_dir=$HOME/.clang" >> $GITHUB_OUTPUT | |
- name: Install LLVM and Clang prerequisites | |
if: steps.test-tree.outputs.src == 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends libtinfo5 | |
- name: Install LLVM and Clang | |
if: steps.test-tree.outputs.src == 'true' | |
uses: KyleMayes/install-llvm-action@82fd451e4380968e8336eefc5b8b9292a619de01 # v2.0.3 | |
with: | |
version: "17.0.6" | |
directory: ${{ steps.set_clang_dir.outputs.clang_dir }} | |
- name: Install ginkgo | |
if: steps.test-tree.outputs.src == 'true' | |
run: | | |
go install github.com/onsi/ginkgo/ginkgo@cc0216944b25a88d3259699a029d4e601fb8a222 # v1.12.1 | |
# Runs only if code under test/ is changed. | |
- name: Check if ginkgo test suite build works for every commit | |
if: steps.test-tree.outputs.src == 'true' | |
run: | | |
set -eu -o pipefail | |
COMMITS=$(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) | |
for commit in $COMMITS ; do | |
git checkout $commit || exit 1 | |
(make -C test build -j $(nproc) && make -C test build-darwin -j $(nproc)) || exit 1 | |
done | |
- name: Failed commit during the build | |
if: ${{ failure() }} | |
run: git --no-pager log --format=%B -n 1 |