Skip to content

feat: added dynamic logger level changes + external logger configuration #3334

feat: added dynamic logger level changes + external logger configuration

feat: added dynamic logger level changes + external logger configuration #3334

name: CI
on:
push:
branches: [main]
pull_request:
branches: ["**"]
permissions:
contents: read
jobs:
legal:
name: Check licenses of dependencies
runs-on: ubuntu-24.04
steps:
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Check for changes in licenses of dependencies
run: |
make legal
if [ -n "$(git status --porcelain)" ]; then
echo "run \"make legal\"."
exit 1
fi
lint:
name: Lint (${{ matrix.target_arch }})
runs-on: ubuntu-24.04
strategy:
matrix:
target_arch: [amd64, arm64]
steps:
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up environment
uses: ./.github/workflows/env
with:
target_arch: ${{ matrix.target_arch }}
- name: linter
env:
GOARCH: ${{ matrix.target-arch }}
CGO_ENABLED: 1
run: make lint
format:
name: Format Go and C code
runs-on: ubuntu-24.04
strategy:
matrix:
target_arch: [amd64]
steps:
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up environment
uses: ./.github/workflows/env
with:
target_arch: ${{ matrix.target_arch }}
- name: formatter
env:
CGO_ENABLED: 1
run: |
make format
git diff --exit-code || (echo 'Code base is not Go or C formatted, please run "make format" and commit the changes in this PR.'; exit 1)
test:
name: Test (${{ matrix.target_arch }}${{ matrix.go_flags }})
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- { target_arch: amd64, go_flags: "" }
- { target_arch: amd64, go_flags: "-race" }
- { target_arch: arm64, go_flags: "" }
# - { target_arch: arm64, go_flags: "-race" } # seem to not work under qemu
steps:
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up environment
uses: ./.github/workflows/env
with:
target_arch: ${{ matrix.target_arch }}
- name: Cache coredump modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: tools/coredump/modulecache
key: coredumps-${{ matrix.target_arch }}-${{ hashFiles('tools/coredump/testdata/*/*.json') }}
restore-keys: |
coredumps-${{ matrix.target_arch }}
coredumps-
- name: Tests
run: make test TARGET_ARCH=${{ matrix.target_arch }} GO_FLAGS="${{ matrix.go_flags }}"
build-integration-test-binaries:
name: Build integration test binaries (${{ matrix.target_arch }})
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
matrix:
target_arch: [amd64, arm64]
steps:
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up environment
uses: ./.github/workflows/env
with:
target_arch: ${{ matrix.target_arch }}
- name: Prepare integration test binaries for qemu tests
run: make integration-test-binaries TARGET_ARCH=${{ matrix.target_arch }}
- name: Upload integration test binaries
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: integration-test-binaries-${{ matrix.target_arch }}
path: support/*.test
coredump-test-macos:
name: Coredump tests (macOS)
runs-on: macos-latest
steps:
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Cache coredump modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: tools/coredump/modulecache
key: coredumps-arm64-${{ hashFiles('tools/coredump/testdata/*/*.json') }}
restore-keys: |
coredumps-arm64
coredumps-
- name: Run coredump tests
run: GODEBUG=asyncpreemptoff=1 go test -v ./tools/coredump/
integration-tests:
name: Integration tests (v${{ matrix.kernel }} ${{ matrix.target_arch }})
runs-on: ubuntu-24.04
needs: build-integration-test-binaries
timeout-minutes: 10
strategy:
matrix:
include:
# List of available kernels here:
# https://github.com/cilium/ci-kernels/pkgs/container/ci-kernels/versions?filters%5Bversion_type%5D=tagged
# AMD64
- { target_arch: amd64, kernel: 5.4.276 }
- { target_arch: amd64, kernel: 5.10.217 }
- { target_arch: amd64, kernel: 5.15.159 }
- { target_arch: amd64, kernel: 6.1.91 }
- { target_arch: amd64, kernel: 6.6.31 }
- { target_arch: amd64, kernel: 6.8.10 }
- { target_arch: amd64, kernel: 6.9.1 }
- { target_arch: amd64, kernel: 6.12.16 }
- { target_arch: amd64, kernel: 6.16 }
# ARM64 (NOTE: older ARM64 kernels are not available in Cilium repos)
- { target_arch: arm64, kernel: 6.6.31 }
- { target_arch: arm64, kernel: 6.8.4 }
- { target_arch: arm64, kernel: 6.9.1 }
- { target_arch: arm64, kernel: 6.12.16 }
# qemu has a bug that prevents booting the following kernel on ARM,
# fixed in qemu 9.2
#- { target_arch: arm64, kernel: 6.16 }
steps:
- name: Disable man-db
run: |
echo "set man-db/auto-update false" | sudo debconf-communicate
sudo dpkg-reconfigure man-db
- name: Clone code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install dependencies
run: |
sudo apt-get update -y
case "${{ matrix.target_arch }}" in
amd64) sudo apt-get -y --no-install-recommends --no-install-suggests install qemu-system-x86 ;;
arm64) sudo apt-get -y --no-install-recommends --no-install-suggests install qemu-system-arm ipxe-qemu ;;
*) echo >&2 "bug: bad arch selected"; exit 1;;
esac
go install github.com/florianl/[email protected]
sudo mv ~/go/bin/bluebox /usr/local/bin/.
- name: Fetch integration test binaries
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with: { name: "integration-test-binaries-${{ matrix.target_arch }}" }
- name: Fetch precompiled kernel
run: |
install -d ci-kernels
echo "FROM ghcr.io/cilium/ci-kernels:${{ matrix.kernel }}" \
| docker buildx build --platform linux/${{ matrix.target_arch }} \
--quiet --pull --output="ci-kernels" -
mv ci-kernels/boot/ ci-kernels/${{ matrix.kernel }}/
- name: Test on kernel ${{ matrix.kernel }}
run: |
chmod a+rx *.test
case "${{ matrix.target_arch }}" in
amd64) export QEMU_ARCH=x86_64;;
arm64) export QEMU_ARCH=aarch64;;
*) echo >&2 "bug: bad arch selected"; exit 1;;
esac
support/run-tests.sh ${{ matrix.kernel }}