Skip to content

Commit

Permalink
ci/gha: use go test -exec sudo
Browse files Browse the repository at this point in the history
Running "sudo go test" results in a different environment, so go has to
recompile everything again.

Use "go test -exec sudo" so test would compile as current user (so that
go build cache is reused), then run as root.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Oct 22, 2024
1 parent 81f3396 commit 52d686d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
shell: bash

- name: Test
run: sudo -E env PATH=$PATH go test -v ./ ./nl
run: go test -exec sudo -v ./ ./nl

build-macos:
# netlink is Linux-only, but this ensures that netlink builds without error
Expand Down

0 comments on commit 52d686d

Please sign in to comment.