Repository navigation
111 lines (92 loc) · 3.2 KB
/
Copy pathci.yml
File metadata and controls
111 lines (92 loc) · 3.2 KB
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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
jobs:
check:
name: check (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
# macOS runner는 proxy.golang.org 연결이 끊겨 module download만으로 job이 실패한 적이 있다.
- name: Download modules
run: |
for attempt in 1 2 3; do
if go mod download; then break; fi
if [ "$attempt" -eq 3 ]; then exit 1; fi
echo "go mod download failed, retrying in 10s"
sleep 10
done
- name: Test and vet
run: make check
- name: Build
run: make build VERSION=ci
# --tls의 BPF는 amd64와 arm64에서 uprobe 인자를 다른 register로 읽는다. 두 machine에서 실제 curl 요청을 잡아 본다.
tls-smoke:
name: tls smoke (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.27.1'
cache: true
- name: Build
run: make build VERSION=ci
- name: Show kernel and libssl
run: |
uname -srm
openssl version
curl --version | head -1
ldd "$(command -v curl)" | grep libssl
- name: Trace an HTTPS request
run: ./scripts/ci-tls-smoke.sh
# capture 시험은 BPF 권한이 없으면 건너뛰므로 root로 돌린다. 건너뛰어도 step은 통과하므로, log에 SKIP이 있으면 실패시킨다.
- name: Trace Go 1.27.1 TLS plaintext
shell: bash
run: |
go test -c -o edc.test ./internal/edc
cd internal/edc
sudo env "PATH=$PATH" EDC_TEST_GO="$(command -v go)" ../../edc.test -test.run '^TestTraceTLSGo(Captures|HTTP2CapturesStreamsAndBodies)$' -test.count=1 -test.v 2>&1 | tee go-tls.log
! grep -- '--- SKIP' go-tls.log
- uses: actions/setup-go@v6
with:
go-version: '1.26.8'
cache: false
- name: Trace Go 1.26.8 TLS plaintext
shell: bash
working-directory: internal/edc
run: |
sudo env "PATH=$PATH" EDC_TEST_GO="$(command -v go)" ../../edc.test -test.run '^TestTraceTLSGo(Captures|HTTP2CapturesStreamsAndBodies)$' -test.count=1 -test.v 2>&1 | tee go-tls.log
! grep -- '--- SKIP' go-tls.log
cross:
name: cross build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
# release가 쓰는 것과 같은 target을 미리 빌드해 태그 뒤에 실패하지 않게 한다.
- name: Build every release target
run: make dist VERSION=ci
- name: Verify checksums
working-directory: dist
run: sha256sum --check checksums.txt