From e14b6d340ba0af3bb0157ca79aadafeb27465172 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Thu, 5 Jan 2023 05:03:06 -0800 Subject: [PATCH] move lint to standalone pipeline (#123) --- .github/workflows/go.yml | 11 ++-------- .github/workflows/golangci-lint.yml | 34 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 968ee5d0..609d7aec 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,14 +16,14 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v3 with: - go-version: ^1.19 + go-version: ^1.19 id: go - name: Check out code into the Go module directory uses: actions/checkout@v3 with: fetch-depth: 0 - submodules: 'recursive' + submodules: 'recursive' # https://github.com/mvdan/github-actions-golang - uses: actions/cache@v3 @@ -39,13 +39,6 @@ jobs: with: setAllVars: true - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - args: --timeout=60m -E gofmt --verbose --print-resources-usage --build-tags full - env: - GOGC: "10" - - name: Test lib ssh run: go test -v -cover ./... working-directory: crypto/ssh diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 00000000..1f998eb3 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,34 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - master + pull_request: +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v3 + with: + go-version: ^1.19 + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'recursive' + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + args: --timeout=60m -E gofmt --verbose --print-resources-usage --build-tags full + env: + GOGC: "10" \ No newline at end of file