whatcanGOwrong

This commit is contained in:
2024-09-19 21:38:24 -04:00
commit d0ae4d841d
17908 changed files with 4096831 additions and 0 deletions
@@ -0,0 +1,73 @@
version: v1.0
name: CI Build
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004
auto_cancel:
running:
when: "branch != 'master'"
blocks:
- name: Run tests
task:
prologue:
commands:
- sudo sh -c 'swapoff -a && fallocate -l 2G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile'
- sem-version go 1.20.1
- export PATH="$PATH:$(go env GOPATH)/bin"
- checkout
# Disabled, see https://github.com/cilium/ebpf/issues/898
# - cache restore
- go mod tidy
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.51.2
- go install gotest.tools/gotestsum@v1.8.1
- sudo pip3 install https://github.com/amluto/virtme/archive/beb85146cd91de37ae455eccb6ab67c393e6e290.zip
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends qemu-system-x86 clang-9 llvm-9
- sudo dmesg -C
epilogue:
always:
commands:
- sudo dmesg
- test-results publish junit.xml
env_vars:
- name: TMPDIR
value: /tmp
- name: CI_MAX_KERNEL_VERSION
value: "5.19"
- name: CI_MIN_CLANG_VERSION
value: "9"
jobs:
- name: Build and Lint
execution_time_limit:
minutes: 10
commands:
- ( export GOOS=darwin; go build ./... && for p in $(go list ./...) ; do go test -c $p || exit ; done )
- ( export GOARCH=arm GOARM=6; go build ./... && for p in $(go list ./...) ; do go test -c $p || exit ; done )
- ( export GOARCH=arm64; go build ./... && for p in $(go list ./...) ; do go test -c $p || exit ; done )
- make clean
- make container-all
- git diff --exit-code || { echo "found unformatted source files, or generated files are not up to date, run 'make'" >&2; false; }
- pushd ./examples
- go build -v -o "$(mktemp -d)" ./...
- popd
- golangci-lint run
- cache store
- name: Run unit tests on previous stable Go
execution_time_limit:
minutes: 10
commands:
- sem-version go 1.19.6
- go test -v ./cmd/bpf2go
- gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- ./run-tests.sh $CI_MAX_KERNEL_VERSION -short -count 1 -json ./...
- name: Run unit tests
execution_time_limit:
minutes: 10
matrix:
- env_var: KERNEL_VERSION
values: ["5.19", "5.15", "5.10", "5.4", "4.19", "4.14", "4.9"]
commands:
- gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- ./run-tests.sh $KERNEL_VERSION -short -count 1 -json ./...