mirror of
https://github.com/imjasonh/snoop
synced 2026-07-14 19:35:42 +00:00
45 lines
899 B
YAML
45 lines
899 B
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.21'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang llvm libbpf-dev linux-headers-generic
|
|
|
|
- name: Generate vmlinux.h
|
|
run: |
|
|
sudo bpftool btf dump file /sys/kernel/btf/vmlinux format c > pkg/ebpf/bpf/vmlinux.h
|
|
|
|
- name: Generate eBPF code
|
|
run: go generate ./pkg/ebpf/bpf
|
|
|
|
- name: Build
|
|
run: go build -v ./cmd/snoop
|
|
|
|
- name: Run tests
|
|
run: go test -v ./...
|
|
|
|
- name: Run go vet
|
|
run: go vet ./...
|
|
|
|
- name: Run staticcheck
|
|
uses: dominikh/staticcheck-action@v1
|
|
with:
|
|
version: "latest"
|