-
Notifications
You must be signed in to change notification settings - Fork 1.5k
170 lines (166 loc) · 5.32 KB
/
go-c-cpp.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: GO/C/C++ CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-on-ubuntu2004:
runs-on: ubuntu-20.04
name: build on ubuntu-20.04 x86_64
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.10'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic gcc gcc-aarch64-linux-gnu libssl-dev
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-9 /usr/bin/$tool
done
shell: bash
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Build
run: |
make clean
make env
DEBUG=1 make nocore -j4
cd ./lib/libpcap/ && sudo make install
cd $GITHUB_WORKSPACE
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --disable-all -E errcheck -E staticcheck
skip-cache: true
problem-matchers: true
- name: Build NOCORE
run: |
make clean
make env
make nocore
- name: Test
run: go test -v -race ./...
build-on-ubuntu2204:
runs-on: ubuntu-22.04
name: build on ubuntu-22.04 x86_64
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.10'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 flex bison linux-tools-common linux-tools-generic gcc gcc-aarch64-linux-gnu libssl-dev linux-source
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
cd /usr/src
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
ls -al /usr/src/$source_dir
shell: bash
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Build CO-RE
run: |
make clean
make env
DEBUG=1 make -j8
cd ./lib/libpcap/ && sudo make install
cd $GITHUB_WORKSPACE
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --disable-all -E errcheck -E staticcheck
skip-cache: true
problem-matchers: true
- name: Build non-CO-RE
run: |
make clean
make env
make nocore
- name: Build CO-RE (Cross-Compilation)
run: |
make clean
CROSS_ARCH=arm64 make env
CROSS_ARCH=arm64 make -j8
- name: Build non-CO-RE (Cross-Compilation/Android)
run: |
make clean
CROSS_ARCH=arm64 make env
ANDROID=1 CROSS_ARCH=arm64 make nocore -j8
- name: Test
run: go test -v -race ./...
build-on-ubuntu2204-arm64:
runs-on: ubuntu-22.04-arm
name: build on ubuntu-22.04 arm64
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.10'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 flex bison linux-tools-common linux-tools-generic gcc gcc-x86-64-linux-gnu libssl-dev linux-source
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
cd /usr/src
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
sudo make ARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- prepare V=0 > /dev/null
ls -al /usr/src/$source_dir
shell: bash
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Build CO-RE
run: |
make clean
make env
DEBUG=1 make -j8
cd ./lib/libpcap/ && sudo make install
cd $GITHUB_WORKSPACE
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --disable-all -E errcheck -E staticcheck
skip-cache: true
problem-matchers: true
- name: Build non-CO-RE
run: |
make clean
make env
make nocore
- name: Build CO-RE (Cross-Compilation)
run: |
make clean
CROSS_ARCH=amd64 make env
CROSS_ARCH=amd64 make -j8
- name: Build non-CO-RE (Cross-Compilation/Android)
run: |
make clean
CROSS_ARCH=amd64 make env
ANDROID=1 CROSS_ARCH=amd64 make nocore -j8
- name: Test
run: go test -v -race ./...