Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,52 @@ on:
- "master"

jobs:
modules:
name: modules
runs-on: ubuntu-latest

permissions:
contents: read

outputs:
paths: ${{ steps.find-modules.outputs.paths }}

steps:
- uses: actions/checkout@v5

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- id: find-modules
shell: sh
run: echo "paths=$(find . -name go.mod | xargs dirname | jq -cnR '[inputs]')" >> $GITHUB_OUTPUT

test:
name: test
runs-on: ubuntu-latest
needs: modules

permissions:
contents: read

strategy:
fail-fast: false
matrix:
paths: ${{ fromJSON(needs.modules.outputs.paths) }}

steps:
- uses: actions/checkout@v5

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- shell: sh
run: |-
cd ${{ matrix.paths }}
go test -v ./...

build:
name: build
runs-on: ubuntu-latest
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,40 @@ on:
- "master"

jobs:
modules:
name: modules
runs-on: ubuntu-latest

permissions:
contents: read

outputs:
paths: ${{ steps.find-modules.outputs.paths }}

steps:
- uses: actions/checkout@v5

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- id: find-modules
shell: sh
run: echo "paths=$(find . -name go.mod | xargs dirname | jq -cnR '[inputs]')" >> $GITHUB_OUTPUT

lint:
name: golangci-lint
runs-on: ubuntu-latest
needs: modules

permissions:
contents: read

strategy:
fail-fast: false
matrix:
paths: ${{ fromJSON(needs.modules.outputs.paths) }}

steps:
- uses: actions/checkout@v5

Expand All @@ -25,3 +52,4 @@ jobs:
with:
# https://github.com/golangci/golangci-lint/releases/tag/v2.4.0
version: v2.4.0
working-directory: ${{ matrix.paths }}
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ linters:
- exhaustruct
- forbidigo
- gochecknoglobals
- gosec
- noinlineerr
- varnamelen
- wrapcheck

# Linters that are deprecated.
Expand Down
Loading