github.com/cilium/ebpf@v0.10.0/.semaphore/semaphore.yml (about)

     1  version: v1.0
     2  name: CI Build
     3  
     4  agent:
     5    machine:
     6      type: e1-standard-2
     7      os_image: ubuntu2004
     8  
     9  execution_time_limit:
    10    minutes: 10
    11  
    12  global_job_config:
    13    secrets:
    14      - name: Coveralls
    15  
    16  auto_cancel:
    17    running:
    18      when: "branch != 'master'"
    19  
    20  blocks:
    21    - name: Run tests
    22      task:
    23        prologue:
    24          commands:
    25            - sudo sh -c 'swapoff -a && fallocate -l 2G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile'
    26            - sem-version go 1.19.1
    27            - export PATH="$PATH:$(go env GOPATH)/bin"
    28            - checkout
    29            # Disabled, see https://github.com/cilium/ebpf/issues/898
    30            # - cache restore
    31            - go mod tidy
    32            - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0
    33            - go install gotest.tools/gotestsum@v1.8.1
    34            - sudo pip3 install https://github.com/amluto/virtme/archive/beb85146cd91de37ae455eccb6ab67c393e6e290.zip
    35            - sudo apt-get update
    36            - sudo apt-get install -y --no-install-recommends qemu-system-x86 clang-9 llvm-9
    37            - sudo dmesg -C
    38        epilogue:
    39          always:
    40            commands:
    41              - sudo dmesg
    42              - test-results publish junit.xml
    43        env_vars:
    44          - name: TMPDIR
    45            value: /tmp
    46          - name: CI_MAX_KERNEL_VERSION
    47            value: "5.19"
    48          - name: CI_MIN_CLANG_VERSION
    49            value: "9"
    50        jobs:
    51        - name: Build and Lint
    52          commands:
    53            - ( export GOOS=darwin; go build ./... && for p in $(go list ./...) ; do go test -c $p || exit ; done )
    54            - ( export GOARCH=arm GOARM=6; go build ./... && for p in $(go list ./...) ; do go test -c $p || exit ; done )
    55            - ( export GOARCH=arm64; go build ./... && for p in $(go list ./...) ; do go test -c $p || exit ; done )
    56            - make clean
    57            - make container-all
    58            - git diff --exit-code || { echo "found unformatted source files, or generated files are not up to date, run 'make'" >&2; false; }
    59            - pushd ./examples
    60            - go build -v -o "$(mktemp -d)" ./...
    61            - popd
    62            - golangci-lint run
    63            - cache store
    64        - name: Run unit tests on previous stable Go
    65          commands:
    66            - sem-version go 1.18
    67            - go test -v ./cmd/bpf2go
    68            - gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- ./run-tests.sh $CI_MAX_KERNEL_VERSION -short -count 1 -json ./...
    69        - name: Run unit tests
    70          matrix:
    71            - env_var: KERNEL_VERSION
    72              values: ["5.19", "5.15", "5.10", "5.4", "4.19", "4.14", "4.9"]
    73          commands:
    74            - gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- ./run-tests.sh $KERNEL_VERSION -short -count 1 -json ./...