version: v1.0 name: CI Build agent: machine: type: e1-standard-2 os_image: ubuntu2004 execution_time_limit: minutes: 30 global_job_config: secrets: - name: Coveralls 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' - checkout - sudo mkdir -p /usr/local/golang/1.18 && curl -fL "https://go.dev/dl/go1.18.linux-amd64.tar.gz" | sudo tar -xz -C /usr/local/golang/1.18 - sem-version go 1.18 - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.0 - export PATH="$PATH:$(go env GOPATH)/bin" - cache restore - go mod tidy - 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 env_vars: - name: TMPDIR value: /tmp - name: CI_MAX_KERNEL_VERSION value: "5.15" jobs: - name: Build and Lint 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 commands: - sem-version go 1.17 - go test -v ./cmd/bpf2go -run TestRun - timeout -s KILL 600s ./run-tests.sh 5.10 - name: Run unit tests matrix: - env_var: KERNEL_VERSION values: ["5.15", "5.10", "5.4", "4.19", "4.14", "4.9"] commands: - timeout -s KILL 600s ./run-tests.sh $KERNEL_VERSION