From 03bbdab472f38092624c131d539d84526eddebb1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jul 2022 10:35:31 +0200 Subject: [PATCH 1/6] gha: format workflows yaml Signed-off-by: Sebastiaan van Stijn --- .github/workflows/validate.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index cd1e6a8..da68e69 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -41,9 +41,9 @@ jobs: cross: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: cross - run: make build-cross + - uses: actions/checkout@v2 + - name: cross + run: make build-cross test: @@ -54,16 +54,16 @@ jobs: race: ["-race", ""] runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: install go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - stable: '!contains(${{ matrix.go-version }}, "beta") && !contains(${{ matrix.go-version }}, "rc")' - go-version: ${{ matrix.go-version }} + - name: install go ${{ matrix.go-version }} + uses: actions/setup-go@v2 + with: + stable: '!contains(${{ matrix.go-version }}, "beta") && !contains(${{ matrix.go-version }}, "rc")' + go-version: ${{ matrix.go-version }} - - name: build - run: make BUILDFLAGS="${{ matrix.race }}" build + - name: build + run: make BUILDFLAGS="${{ matrix.race }}" build - - name: test - run: make TESTFLAGS="${{ matrix.race }}" test + - name: test + run: make TESTFLAGS="${{ matrix.race }}" test From a836db9a3c7e1c29d1f28978b1b43e3b8fa150d8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jul 2022 10:39:45 +0200 Subject: [PATCH 2/6] gha: update to actions/checkout@v3 changelog; https://github.com/actions/checkout/blob/v3.0.2/CHANGELOG.md Signed-off-by: Sebastiaan van Stijn --- .github/workflows/validate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index da68e69..35c18e3 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -30,7 +30,7 @@ jobs: lint: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: golangci/golangci-lint-action@v2 with: # must be specified without patch version @@ -41,7 +41,7 @@ jobs: cross: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cross run: make build-cross @@ -54,7 +54,7 @@ jobs: race: ["-race", ""] runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install go ${{ matrix.go-version }} uses: actions/setup-go@v2 From e2be4dc1127c7da255eab422b2a2805b74850f79 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jul 2022 10:46:27 +0200 Subject: [PATCH 3/6] gha: update golangci-lint to v1.46.x Signed-off-by: Sebastiaan van Stijn --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 35c18e3..f6a4734 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -34,7 +34,7 @@ jobs: - uses: golangci/golangci-lint-action@v2 with: # must be specified without patch version - version: v1.36 + version: v1.46 # Only show new issues for a pull request. only-new-issues: true From dad7b661d3bdd6d3ffec6bf8e5fdc0f8493e68a9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jul 2022 11:13:50 +0200 Subject: [PATCH 4/6] gofmt with go 1.19 - to get new build-tag format - to account for go1.19 changes in formatting godoc Signed-off-by: Sebastiaan van Stijn --- go-selinux/doc.go | 1 - go-selinux/label/label_stub.go | 1 + go-selinux/label/label_stub_test.go | 1 + go-selinux/rchcon.go | 1 + go-selinux/rchcon_go115.go | 1 + go-selinux/selinux_stub.go | 1 + go-selinux/selinux_stub_test.go | 1 + 7 files changed, 6 insertions(+), 1 deletion(-) diff --git a/go-selinux/doc.go b/go-selinux/doc.go index 0ac7d81..57a15c9 100644 --- a/go-selinux/doc.go +++ b/go-selinux/doc.go @@ -9,6 +9,5 @@ Usage: if selinux.EnforceMode() != selinux.Enforcing { selinux.SetEnforceMode(selinux.Enforcing) } - */ package selinux diff --git a/go-selinux/label/label_stub.go b/go-selinux/label/label_stub.go index 02d2062..f21c80c 100644 --- a/go-selinux/label/label_stub.go +++ b/go-selinux/label/label_stub.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package label diff --git a/go-selinux/label/label_stub_test.go b/go-selinux/label/label_stub_test.go index 08137dd..38abcd8 100644 --- a/go-selinux/label/label_stub_test.go +++ b/go-selinux/label/label_stub_test.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package label diff --git a/go-selinux/rchcon.go b/go-selinux/rchcon.go index feb739d..fa1440d 100644 --- a/go-selinux/rchcon.go +++ b/go-selinux/rchcon.go @@ -1,3 +1,4 @@ +//go:build linux && go1.16 // +build linux,go1.16 package selinux diff --git a/go-selinux/rchcon_go115.go b/go-selinux/rchcon_go115.go index ecc7abf..303cb18 100644 --- a/go-selinux/rchcon_go115.go +++ b/go-selinux/rchcon_go115.go @@ -1,3 +1,4 @@ +//go:build linux && !go1.16 // +build linux,!go1.16 package selinux diff --git a/go-selinux/selinux_stub.go b/go-selinux/selinux_stub.go index 78743b0..20d8880 100644 --- a/go-selinux/selinux_stub.go +++ b/go-selinux/selinux_stub.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package selinux diff --git a/go-selinux/selinux_stub_test.go b/go-selinux/selinux_stub_test.go index 20b5b21..06df12a 100644 --- a/go-selinux/selinux_stub_test.go +++ b/go-selinux/selinux_stub_test.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package selinux From c80a178bec3bc4905038521bcf6ac9b2a681259a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jul 2022 10:48:47 +0200 Subject: [PATCH 5/6] gha: drop go 1.15, add go 1.18 Signed-off-by: Sebastiaan van Stijn --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f6a4734..94d6268 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.15.x, 1.16.x, 1.17.x] + go-version: [1.16.x, 1.17.x, 1.18.x] race: ["-race", ""] runs-on: ubuntu-20.04 steps: From 03ab91c2bbd7fe69342eea6cb7dc17749f815b6e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 19 Jul 2022 11:10:57 +0200 Subject: [PATCH 6/6] gha: update to golangci/golangci-lint-action@v3 v3 requires Go to be set up manually (whereas previous versions would install their own version, which may not match the expected version). Also removing the "new code only" constraint; let's just check all code for issues. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/validate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 94d6268..72a41a4 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,12 +31,12 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: golangci/golangci-lint-action@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.18.x + - uses: golangci/golangci-lint-action@v3 with: - # must be specified without patch version version: v1.46 - # Only show new issues for a pull request. - only-new-issues: true cross: runs-on: ubuntu-20.04