Skip to content

Merging Caches into one version #12

Merging Caches into one version

Merging Caches into one version #12

Workflow file for this run

name: lint
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
generate-matrix:
name: Generate matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set matrix
id: set-matrix
run: |
MODULES=$(find . -type f -name "go.mod" | sed -e 's/\/go.mod//g' | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${MODULES}" >> $GITHUB_OUTPUT
golangci:
name: golangci
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix:
modules: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.21'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
# Optional: working directory, useful for monorepos
working-directory: ${{ matrix.modules }}
# Optional: golangci-lint command line arguments.
args: -E misspell -E revive -E gochecknoinits -E gofmt -E errname
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true