diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 8e9236a4..f0ba5489 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -27,7 +27,6 @@ jobs: if: steps.cached-go-dependencies.outputs.cache-hit != 'true' shell: bash run: go get -v -t ./... - - name: Setup Node uses: actions/setup-node@v3 with: @@ -60,5 +59,23 @@ jobs: with: path: ~/.cache/pre-commit/ key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} - - name: Execute Pre-Commit + - name: Lint + if: github.ref != 'refs/heads/main' run: pre-commit run --show-diff-on-failure --color=always --all-files + # on main we are executing the longer linting which includes spotless - but its very slow, so only on main. + - name: Install Task + if: github.ref == 'refs/heads/main' + uses: arduino/setup-task@v1 + - name: Setup Java + if: github.ref == 'refs/heads/main' + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + - name: Enable gradlew execution + if: github.ref == 'refs/heads/main' + run: chmod +x gradlew + - name: Lint + if: github.ref == 'refs/heads/main' + run: task lint diff --git a/Taskfile.yaml b/Taskfile.yaml index e16f35d3..0588c172 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -95,7 +95,7 @@ tasks: lint: desc: Lint the project cmds: - - pre-commit run --all-files + - pre-commit run --show-diff-on-failure --color=always --all-files - task: lint:android # database db:up: