From ff0ae6383ce017190dc4380c6711715ba9d86c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 12 Jun 2024 18:06:35 -0700 Subject: [PATCH] add separate jobs --- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f161488..43b26cf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ on: env: GO_VERSION: '1.22' + GOLANGCI_LINT_VERSION: 'v1.54' jobs: paths-filter: @@ -63,6 +64,22 @@ jobs: working-directory: test run: make check-tidy + lint-test: + needs: paths-filter + if: ${{ needs.paths-filter.outputs.test == 'true' }} + name: Lint (Test Framework) + runs-on: ubuntu-20.04 + steps: + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + working-directory: test + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: ${{ env.GOLANGCI_LINT_VERSION }} + args: -v + # https://github.com/golangci/golangci-lint-action/issues/244 + skip-cache: true + test-lint: needs: paths-filter if: ${{ needs.paths-filter.outputs.lint == 'true' }} @@ -88,6 +105,22 @@ jobs: working-directory: lint run: make check-tidy + lint-lint: + needs: paths-filter + if: ${{ needs.paths-filter.outputs.lint == 'true' }} + name: Lint (Lint) + runs-on: ubuntu-20.04 + steps: + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + working-directory: lint + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: ${{ env.GOLANGCI_LINT_VERSION }} + args: -v + # https://github.com/golangci/golangci-lint-action/issues/244 + skip-cache: true + test-languageserver: needs: paths-filter if: ${{ needs.paths-filter.outputs.languageserver == 'true' }} @@ -121,6 +154,22 @@ jobs: working-directory: languageserver run: make check-tidy + lint-languageserver: + needs: paths-filter + if: ${{ needs.paths-filter.outputs.languageserver == 'true' }} + name: Lint (Language Server) + runs-on: ubuntu-20.04 + steps: + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + working-directory: languageserver + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: ${{ env.GOLANGCI_LINT_VERSION }} + args: -v + # https://github.com/golangci/golangci-lint-action/issues/244 + skip-cache: true + test-docgen: needs: paths-filter if: ${{ needs.paths-filter.outputs.docgen == 'true' }} @@ -148,8 +197,24 @@ jobs: working-directory: docgen run: make check-tidy - lint: - name: Lint + lint-docgen: + needs: paths-filter + if: ${{ needs.paths-filter.outputs.docgen == 'true' }} + name: Lint (Docgen) + runs-on: ubuntu-20.04 + steps: + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + working-directory: docgen + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: ${{ env.GOLANGCI_LINT_VERSION }} + args: -v + # https://github.com/golangci/golangci-lint-action/issues/244 + skip-cache: true + + check-license-headers: + name: Check license headers runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -166,11 +231,3 @@ jobs: ${{ runner.os }}-go- - name: Check license headers run: make check-headers - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.54 - args: -v - # https://github.com/golangci/golangci-lint-action/issues/244 - skip-cache: true