From 29ed17d19cb48ed1b51da649001176e7e9698e69 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:42:16 +0200 Subject: [PATCH] build: add linting for different values of GOOS --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c1136d5d..3a939f19d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -226,18 +226,50 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Code quality test - uses: golangci/golangci-lint-action@v4 - with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: latest - - # Run govulncheck on the latest go version, the one we build binaries with - name: Install Go uses: actions/setup-go@v5 with: go-version: '>=1.22.0-rc.1' check-latest: true + cache: false + + - name: Code quality test (Linux) + uses: golangci/golangci-lint-action@v4 + with: + version: latest + skip-cache: false # Caching enabled (which is default) on this first lint step only, it handles complete cache of build, go modules and golangci-lint analysis which was necessary to get all lint steps to properly take advantage of it + + - name: Code quality test (Windows) + uses: golangci/golangci-lint-action@v4 + env: + GOOS: "windows" + with: + version: latest + skip-cache: true + + - name: Code quality test (macOS) + uses: golangci/golangci-lint-action@v4 + env: + GOOS: "darwin" + with: + version: latest + skip-cache: true + + - name: Code quality test (FreeBSD) + uses: golangci/golangci-lint-action@v4 + env: + GOOS: "freebsd" + with: + version: latest + skip-cache: true + + - name: Code quality test (OpenBSD) + uses: golangci/golangci-lint-action@v4 + env: + GOOS: "openbsd" + with: + version: latest + skip-cache: true - name: Install govulncheck run: go install golang.org/x/vuln/cmd/govulncheck@latest