Skip to content

chore: improve makefile to avoid the tools file #235

chore: improve makefile to avoid the tools file

chore: improve makefile to avoid the tools file #235

Workflow file for this run

name: Lint
on:
pull_request:
push:
paths-ignore:
- '**.md'
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
list-directories:
name: List root package directories
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3.4.0
- id: set-matrix
run: |
PATHS=$(find . -maxdepth 2 -type f -name go.mod -printf '"%h",')
echo "matrix=[${PATHS%?}]" >> $GITHUB_OUTPUT
lint:
name: 'Lint Go Code: ${{ matrix.package-directory }}'
runs-on: ubuntu-latest
timeout-minutes: 6
needs: list-directories
strategy:
matrix:
package-directory: ${{ fromJson(needs.list-directories.outputs.matrix) }}
steps:
- uses: actions/checkout@v3.4.0
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/*.go
*/go.mod
*/go.sum
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
go-version: '1.21'
- uses: golangci/golangci-lint-action@v3
if: env.GIT_DIFF
with:
version: v1.52.1
install-mode: goinstall
args: --timeout 10m
github-token: ${{ secrets.github_token }}
working-directory: ${{ matrix.package-directory }}