From c2d899f2a310a8dfcc55901ecdef733ef4e569e7 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Mon, 18 Jan 2021 23:52:48 -0500 Subject: [PATCH] Tweak build action --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f85e99d8..24cd1d50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - run: sudo su - name: Set up Go 1.15 uses: actions/setup-go@v2 with: @@ -25,7 +24,10 @@ jobs: - name: Build binary to make sure it works run: go build -mod vendor - name: Test - run: sudo --preserve-env go test -mod vendor ./... -race -coverprofile=coverage.txt -covermode=atomic + # We're using "sudo" because one of the tests leverages ping, which requires super-user privileges. + # As for the "PATH=$PATH", we need it to use the same "go" executable that was configured by the "Set + # up Go" step. + run: sudo "PATH=$PATH" go test -mod vendor ./... -race -coverprofile=coverage.txt -covermode=atomic - name: Codecov uses: codecov/codecov-action@v1.0.14 with: