[agy] test: add --attack flag to simagent #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | |
| with: | |
| go-version: '1.25.0' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run all tests (Unit, Integration, and E2E) | |
| # We run everything with sudo so the eBPF/fanotify tests execute fully | |
| run: sudo go test -v ./... | |
| bpf-freshness: | |
| name: BPF Objects Up To Date | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | |
| with: | |
| go-version: '1.25.0' | |
| - name: Install clang and libbpf headers | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y clang llvm libbpf-dev | |
| - name: Regenerate BPF objects | |
| run: go generate ./pkg/probe/proc/... | |
| - name: Fail if regeneration changed committed files | |
| # proc.bpf.c is compiled locally and its .o/.go bindings are committed | |
| # (CI has no clang in the test job, so it can't build them at test | |
| # time). If this step fails, someone edited proc.bpf.c without running | |
| # `go generate ./pkg/probe/proc/...` and committing the result. | |
| run: | | |
| if [ -n "$(git status --porcelain -- pkg/probe/proc | grep -v '\.o$')" ]; then | |
| echo "::error::Committed BPF bindings in pkg/probe/proc are stale. Run 'go generate ./pkg/probe/proc/...' and commit the result." | |
| git diff -- pkg/probe/proc | |
| git status --porcelain -- pkg/probe/proc | |
| exit 1 | |
| fi |