diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 41e66a23..6ec9770d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,8 +20,23 @@ on: - ".github/dependabot.yml" jobs: - golangci-lint: + prepare-matrix: runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Fetch Repository + uses: actions/checkout@v4 + - id: set-matrix + run: | + echo "::set-output name=matrix::$(find . -type d -not -path '*/\.*' | jq -R -s -c 'split("\n")[:-1]')" + + golangci-lint: + needs: prepare-matrix + runs-on: ubuntu-latest + strategy: + matrix: + directory: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} steps: - name: Fetch Repository uses: actions/checkout@v4 @@ -29,3 +44,4 @@ jobs: uses: reviewdog/action-golangci-lint@v2 with: golangci_lint_flags: "--tests=false" + working-directory: ${{ matrix.directory }}