fix: enhance installation instructions for WireGuard setup and persis… #142
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: [v4] | |
| paths: | |
| - "core/**" | |
| pull_request: | |
| branches: [v4] | |
| paths: | |
| - "core/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} with Go ${{ matrix.go-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| go-version: ["1.26"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache-dependency-path: core/go.sum | |
| - name: Install dependencies | |
| working-directory: ./core | |
| run: go mod tidy | |
| - name: Run tests (Linux, with race & coverage) | |
| if: runner.os == 'Linux' | |
| working-directory: ./core | |
| env: | |
| EMP3R0R_RACE_ON: "1" | |
| run: | | |
| go test -v -race "-coverprofile=coverage.txt" -covermode=atomic ./... | |
| - name: Run Linux BOF loader test (cgo) | |
| if: runner.os == 'Linux' | |
| working-directory: ./core | |
| env: | |
| CGO_ENABLED: 1 | |
| run: | | |
| go test -v ./lib/coffloader -run TestRunLinuxCOFFWithInlineBOF -count=1 | |
| - name: Run exeutil ELF loader test (cgo) | |
| if: runner.os == 'Linux' | |
| working-directory: ./core | |
| env: | |
| CGO_ENABLED: 1 | |
| run: | | |
| go test -v ./lib/exeutil -run TestInMemExeRun -count=1 | |
| - name: Install zig (for shellcode stager test) | |
| if: runner.os == 'Linux' | |
| run: | | |
| wget -q https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz | |
| tar -xf zig-linux-x86_64-0.13.0.tar.xz | |
| sudo mv zig-linux-x86_64-0.13.0 /usr/local/zig | |
| sudo ln -sf /usr/local/zig/zig /usr/local/bin/zig | |
| - name: Run shellcode stager lifecycle test (cgo, no race) | |
| if: runner.os == 'Linux' | |
| working-directory: ./core/modules/shellcode_stager | |
| env: | |
| CGO_ENABLED: 1 | |
| run: | | |
| cd test && go test -v -count=1 -timeout 3m -run TestAgentEndToEndLifecycle | |
| - name: Run tests (Windows, with race) | |
| if: runner.os == 'Windows' | |
| working-directory: ./core | |
| env: | |
| EMP3R0R_RACE_ON: "1" | |
| run: | | |
| go test -v -race ./... | |
| - name: Run BOF integration without race (Windows only) | |
| if: runner.os == 'Windows' | |
| working-directory: ./core | |
| env: | |
| EMP3R0R_RACE_ON: "0" | |
| run: | | |
| go test -v ./internal/agent/modules -run TestRunCOFFModuleWithRealBOF | |
| - name: Display coverage summary | |
| if: runner.os == 'Linux' | |
| working-directory: ./core | |
| run: | | |
| go tool cover -func=coverage.txt | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./core/coverage.txt | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false |