/
semaphore.yml
73 lines (68 loc) · 2.74 KB
/
semaphore.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: v1.0
name: CI Build
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004
execution_time_limit:
minutes: 10
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'
- sem-version go 1.19.1
- export PATH="$PATH:$(go env GOPATH)/bin"
- checkout
- 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.48.0
- 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
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.18
- 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
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 ./...