From c7259506332b38e8964295bd0834c8859337f28c Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Fri, 27 Dec 2024 18:00:41 +0000 Subject: [PATCH] (ci): Improve GitHub Action to linter simples This commit change the action in order to use a matrix to validate all samples under testdata --- .github/workflows/lint-sample.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint-sample.yml b/.github/workflows/lint-sample.yml index 7ac928c9c2c..4d053362669 100644 --- a/.github/workflows/lint-sample.yml +++ b/.github/workflows/lint-sample.yml @@ -11,6 +11,13 @@ on: jobs: lint-samples: runs-on: ubuntu-latest + strategy: + matrix: + folder: [ + "testdata/project-v4", + "testdata/project-v4-with-plugins", + "testdata/project-v4-multigroup" + ] if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) steps: - name: Clone the code @@ -19,15 +26,12 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.mod + - name: Prepare ${{ matrix.folder }} + working-directory: ${{ matrix.folder }} + run: go mod tidy - name: Run linter uses: golangci/golangci-lint-action@v6 with: version: v1.59 - working-directory: testdata/project-v4 - args: --config .golangci.yml ./... - - name: Run linter - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59 - working-directory: testdata/project-v4-with-plugins - args: --config .golangci.yml ./... + working-directory: ${{ matrix.folder }} + args: --config .golangci.yml ./... \ No newline at end of file