diff --git a/.github/workflows/failpoint_test.yaml b/.github/workflows/failpoint_test.yaml index 376ea1604..866c2f3f2 100644 --- a/.github/workflows/failpoint_test.yaml +++ b/.github/workflows/failpoint_test.yaml @@ -15,10 +15,6 @@ jobs: - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 - run: | make gofail-enable make test-failpoint diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..0696ca2de --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,11 @@ +--- +name: Lint +permissions: read-all +on: [push, pull_request] +jobs: + lint-linux: + uses: ./.github/workflows/lint_template.yml + lint-windows: + uses: ./.github/workflows/lint_template.yml + with: + runs-on: windows-latest diff --git a/.github/workflows/lint_template.yaml b/.github/workflows/lint_template.yaml new file mode 100644 index 000000000..a51109aca --- /dev/null +++ b/.github/workflows/lint_template.yaml @@ -0,0 +1,26 @@ +--- +name: Reusable lint Workflow +on: + workflow_call: + inputs: + runs-on: + required: false + type: string + default: ubuntu-latest +permissions: read-all + +jobs: + lint: + runs-on: ${{ inputs.runs-on }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + shell: bash + - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 + with: + version: v2.10.1 diff --git a/.github/workflows/robustness_template.yaml b/.github/workflows/robustness_template.yaml index ebe8af6ea..f7bf024ee 100644 --- a/.github/workflows/robustness_template.yaml +++ b/.github/workflows/robustness_template.yaml @@ -29,10 +29,6 @@ jobs: - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 - name: test-robustness run: | set -euo pipefail diff --git a/.github/workflows/tests-template.yml b/.github/workflows/tests-template.yml index b848b4a30..a4d74f37d 100644 --- a/.github/workflows/tests-template.yml +++ b/.github/workflows/tests-template.yml @@ -49,7 +49,3 @@ jobs: exit 1 ;; esac - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 diff --git a/.github/workflows/tests_amd64.yaml b/.github/workflows/tests_amd64.yaml index cb94077fd..a19d78605 100644 --- a/.github/workflows/tests_amd64.yaml +++ b/.github/workflows/tests_amd64.yaml @@ -23,8 +23,4 @@ jobs: - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 - run: make coverage diff --git a/.github/workflows/tests_arm64.yaml b/.github/workflows/tests_arm64.yaml index ec6c5001a..ebea1141a 100644 --- a/.github/workflows/tests_arm64.yaml +++ b/.github/workflows/tests_arm64.yaml @@ -25,8 +25,4 @@ jobs: - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 - run: make coverage diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 956d9ab2d..d9fd8c18d 100644 --- a/.github/workflows/tests_windows.yml +++ b/.github/workflows/tests_windows.yml @@ -40,10 +40,6 @@ jobs: ;; esac shell: bash - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 coverage: needs: ["test-windows"] @@ -56,10 +52,6 @@ jobs: - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: ${{ steps.goversion.outputs.goversion }} - - name: Run golangci-lint - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 - with: - version: v2.10.1 - run: make coverage env: TIMEOUT: 60m