Skip to content

Commit

Permalink
Merge pull request #67 from coroot/continuous_integration
Browse files Browse the repository at this point in the history
Continuous Integration
  • Loading branch information
apetruhin authored Feb 6, 2024
2 parents 3e408fa + 48e3d5f commit c5aa3fc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Continuous Integration

on:
pull_request:
push:
branches:
- main

jobs:
GO:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- run: sudo apt install -y libsystemd-dev
- name: gofmt -l .
run: files=$(gofmt -l .); if [[ -n "$files" ]]; then echo "$files"; exit 1; fi
- name: goimports -l .
run: |
go install golang.org/x/tools/cmd/goimports@latest
files=$(goimports -l .); if [[ -n "$files" ]]; then echo "$files"; exit 1; fi
- run: go vet ./...
- run: go test ./...
- run: go build -mod=readonly .
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go test ./...
ARG VERSION=unknown
RUN CGO_ENABLED=1 go build -mod=readonly -ldflags "-X main.version=$VERSION" -o coroot-node-agent .

Expand Down
1 change: 1 addition & 0 deletions ebpftracer/l7/l7_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestParseMongo(t *testing.T) {
buf := bytes.NewBuffer(nil)
v := bson.M{"a": "bssssssssssssssssssssssssssssssssssssssssss"}
data, err := bson.Marshal(v)
assert.NoError(t, err)

h := mongoHeader{
MessageLength: 16 + 4 + 1 + int32(len(data)),
Expand Down
2 changes: 1 addition & 1 deletion proc/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func readSockets(src string) ([]Sock, error) {
_, b = nextField(b)
_, b = nextField(b)
_, b = nextField(b)
inode, b := nextField(b)
inode, _ := nextField(b)
res = append(res, Sock{SAddr: decodeAddr(local), DAddr: decodeAddr(remote), Listen: state == stateListen, Inode: string(inode)})
}
return res, nil
Expand Down

0 comments on commit c5aa3fc

Please sign in to comment.