add CAP_NET_RAW to github worker running tests #1331
Workflow file for this run
This file contains 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: test | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- run: sudo apt-get install libpcap-dev libcap2-bin | |
- run: go build -v ./... | |
# fuzzing, need to specify each package separately | |
- run: go test -v -fuzz='.*' -fuzztime=10s ./ptp/protocol/ | |
- run: go test -v -fuzz='.*' -fuzztime=10s ./ntp/protocol/ | |
- run: go test -v -fuzz='.*' -fuzztime=10s ./ntp/chrony/ | |
- name: Run coverage | |
run: sudo capsh --inh=cap_net_raw --print -- -c "go test -v -race -coverprofile=coverage.txt -covermode=atomic ./..." | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |