WIP: reproduce netlify build failures #1362
Workflow file for this run
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: ci | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
TMPDIR: /tmp | |
CI_MAX_KERNEL_VERSION: '6.8' | |
CI_MIN_CLANG_VERSION: '11' | |
go_version: '~1.23' | |
prev_go_version: '~1.22' | |
CGO_ENABLED: '0' | |
# This needs to match whatever Netlify supports. | |
# Also defined in Pipfile. | |
python_version: '~3.8' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
build-and-lint: | |
name: Build and Lint | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '${{ env.go_version }}' | |
- name: Run golangci-lint | |
uses: golangci/[email protected] | |
with: | |
args: "--out-format colored-line-number" | |
- name: Generate and format code | |
run: | | |
make clean && make container-all | |
if ! git diff --exit-code; then | |
echo "found unformatted source files, or generated files are not up to date, run 'make'" >&2 | |
exit 1 | |
fi | |
- name: Test bpf2go | |
run: | | |
sudo apt-get install clang-11 llvm-11 | |
go test -v ./cmd/bpf2go | |
- name: Build examples | |
run: go build -v ./... | |
working-directory: ./examples | |
- name: Cross build windows | |
env: | |
GOOS: windows | |
run: | | |
go build -v ./... | |
go test -c -o /dev/null ./... >/dev/null | |
- name: Cross build arm32 | |
env: | |
GOARCH: arm | |
GOARM: 6 | |
run: | | |
go build -v ./... | |
go test -c -o /dev/null ./... >/dev/null | |
build-docs: | |
name: Build Documentation | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# The mkdocs git-authors plugin needs access to the full revision | |
# history to correctly generate its statistics. | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '${{ env.go_version }}' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '${{ env.python_version }}' | |
cache: 'pipenv' | |
- name: Install pipenv | |
run: pip3 install pipenv | |
- name: Install Dependencies | |
run: pipenv install | |
working-directory: ./docs | |
- name: Build Documentation | |
run: make build | |
working-directory: ./docs | |
test-on-prev-go: | |
name: Run tests on previous stable Go | |
runs-on: ubuntu-latest | |
needs: build-and-lint | |
timeout-minutes: 15 | |
env: | |
CI_KERNEL_SELFTESTS: '/usr/src/linux/tools/testing/selftests/bpf' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '${{ env.prev_go_version }}' | |
- run: go install lmb.io/vimto@latest | |
- run: go install gotest.tools/[email protected] | |
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends qemu-system-x86 | |
- run: sudo chmod 0666 /dev/kvm | |
- name: Test | |
env: | |
GOTRACEBACK: crash | |
run: | | |
gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- vimto -kernel :stable-selftests -- go test -timeout 5m -short -count 1 -json ./... | |
- name: Benchmark | |
run: vimto -kernel :stable-selftests -- go test -short -run '^$' -bench . -benchtime=1x ./... | |
- name: Upload coredumps | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: cores | |
if-no-files-found: ignore | |
path: | | |
**/core-* | |
**/*.test | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results (previous stable Go) | |
path: junit.xml | |
test-on-arm64: | |
name: Run tests on arm64 | |
runs-on: ubuntu-22.04-arm64 | |
needs: build-and-lint | |
timeout-minutes: 15 | |
env: | |
EBPF_TEST_IGNORE_VERSION: 'TestKprobeMulti,TestKprobeMultiErrors,TestKprobeMultiCookie,TestKprobeMultiProgramCall,TestHaveBPFLinkKprobeMulti,TestHaveProgramType/LircMode2' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '${{ env.go_version }}' | |
- run: go install gotest.tools/[email protected] | |
- name: Test | |
# Skip TestGoarches/loong64 because the GH arm64 Go toolchain seems to be weird. | |
run: gotestsum --ignore-non-json-output-lines --junitfile junit.xml -- -exec 'sudo -E' -short -count 1 -skip '^TestGoarches/loong64$' -json ./... | |
- name: Benchmark | |
run: go test -exec sudo -short -run '^$' -bench . -benchtime=1x ./... | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results (arm64) | |
path: junit.xml | |
- name: Show dmesg | |
if: failure() | |
run: | | |
sudo dmesg | |
vm-test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
needs: build-and-lint | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
tag: | |
- "mainline" | |
- "stable" | |
- "6.6" | |
- "6.1" | |
- "5.15" | |
- "5.10" | |
- "5.4" | |
- "4.19" | |
- "4.14" | |
- "4.9" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '${{ env.go_version }}' | |
- run: go install gotest.tools/[email protected] | |
- run: go install lmb.io/vimto@latest | |
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends qemu-system-x86 | |
- run: sudo chmod 0666 /dev/kvm | |
- name: Test | |
run: gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- vimto -kernel :${{ matrix.tag }} -- go test -short -count 1 -json ./... | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results (${{ matrix.tag }}) | |
path: junit.xml |