From e223f02bfde6fb92ddd2207077cd303eae75d6d0 Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Mon, 16 Dec 2024 14:01:41 +0100 Subject: [PATCH] ci: replace golangci-lint, shellcheck and actionlint with nix flake check Signed-off-by: Paul Meyer --- .github/workflows/lint.yml | 53 +++++++------------------------------- 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ea6ec8a..26625ca 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,19 +8,20 @@ on: pull_request: jobs: - golangci-lint: + flake-check: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Setup Go environment - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30 with: - go-version: "stable" - - name: Run golangci-lint - uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 + github_access_token: ${{ secrets.GITHUB_TOKEN }} + - uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15 with: - args: --timeout=30m + name: edgelesssys + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: Run nix flake check + run: | + nix -L flake check go-tidy: runs-on: ubuntu-latest @@ -48,40 +49,6 @@ jobs: go install golang.org/x/vuln/cmd/govulncheck@latest govulncheck ./... - shellcheck: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0 - with: - severity: info - - actionlint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Setup Go environment - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 - with: - go-version: "stable" - - name: Install ShellCheck - env: - SHELLCHECK_VER: v0.9.0 - run: | - baseurl=https://github.com/koalaman/shellcheck/releases/download - curl -fsSLO "${baseurl}/${SHELLCHECK_VER}/shellcheck-${SHELLCHECK_VER}.linux.x86_64.tar.xz" - tar -xf "shellcheck-${SHELLCHECK_VER}.linux.x86_64.tar.xz" - sudo mv "./shellcheck-${SHELLCHECK_VER}/shellcheck" "${{ github.action_path }}/shellcheck" - rm -rf "shellcheck-${SHELLCHECK_VER}" "shellcheck-${SHELLCHECK_VER}.linux.x86_64.tar.xz" - - name: Run Actionlint - shell: bash - run: | - go install github.com/rhysd/actionlint/cmd/actionlint@latest - actionlint - vendorhash: runs-on: ubuntu-latest permissions: