build(deps): bump google.golang.org/grpc from 1.66.0 to 1.68.0 in /content #460
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
# **What it does**: Runs go linter when go files have been modified | |
# and proto linters when proto files have been modified. | |
# | |
# **Why we have it**: Ensures all go files and proto files are | |
# properly formatted according to lint configuration files. | |
# | |
# **What does it impact**: Code quality. | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
golangci: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read # for technote-space/get-diff-action to get git reference | |
strategy: | |
matrix: | |
module: ["admin", "content", "governor", "subject", "validator", "voucher"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-admin | |
with: | |
PATTERNS: | | |
admin/**/**.go | |
admin/go.mod | |
admin/go.sum | |
if: matrix.module == 'admin' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-content | |
with: | |
PATTERNS: | | |
content/**/**.go | |
content/go.mod | |
content/go.sum | |
if: matrix.module == 'content' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-governor | |
with: | |
PATTERNS: | | |
governor/**/**.go | |
governor/go.mod | |
governor/go.sum | |
if: matrix.module == 'governor' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-subject | |
with: | |
PATTERNS: | | |
subject/**/**.go | |
subject/go.mod | |
subject/go.sum | |
if: matrix.module == 'subject' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-voucher | |
with: | |
PATTERNS: | | |
voucher/**/**.go | |
voucher/go.mod | |
voucher/go.sum | |
if: matrix.module == 'voucher' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-validator | |
with: | |
PATTERNS: | | |
validator/**/**.go | |
validator/go.mod | |
validator/go.sum | |
if: matrix.module == 'validator' | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'admin/go.mod' | |
if: steps.git-diff-admin.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'content/go.mod' | |
if: steps.git-diff-content.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'governor/go.mod' | |
if: steps.git-diff-governor.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'subject/go.mod' | |
if: steps.git-diff-subject.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'validator/go.mod' | |
if: steps.git-diff-validator.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'voucher/go.mod' | |
if: steps.git-diff-voucher.outputs.diff | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: "admin" | |
if: steps.git-diff-admin.outputs.diff | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: "content" | |
if: steps.git-diff-content.outputs.diff | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: "governor" | |
if: steps.git-diff-governor.outputs.diff | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: "subject" | |
if: steps.git-diff-subject.outputs.diff | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: "validator" | |
if: steps.git-diff-validator.outputs.diff | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: "voucher" | |
if: steps.git-diff-voucher.outputs.diff | |
buf-lint: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read # for technote-space/get-diff-action to get git reference | |
strategy: | |
matrix: | |
module: ["admin", "content", "governor", "subject", "validator", "voucher"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-admin | |
with: | |
PATTERNS: | | |
admin/**/**.proto | |
if: matrix.module == 'admin' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-content | |
with: | |
PATTERNS: | | |
content/**/**.proto | |
if: matrix.module == 'content' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-governor | |
with: | |
PATTERNS: | | |
governor/**/**.proto | |
if: matrix.module == 'governor' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-subject | |
with: | |
PATTERNS: | | |
subject/**/**.proto | |
if: matrix.module == 'subject' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-validator | |
with: | |
PATTERNS: | | |
validator/**/**.proto | |
if: matrix.module == 'validator' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-voucher | |
with: | |
PATTERNS: | | |
voucher/**/**.proto | |
if: matrix.module == 'voucher' | |
- uses: bufbuild/buf-setup-action@v1 | |
if: | | |
steps.git-diff-admin.outputs.diff || | |
steps.git-diff-content.outputs.diff || | |
steps.git-diff-governor.outputs.diff || | |
steps.git-diff-subject.outputs.diff || | |
steps.git-diff-validator.outputs.diff || | |
steps.git-diff-voucher.outputs.diff | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'admin/proto' | |
if: steps.git-diff-admin.outputs.diff | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'content/proto' | |
if: steps.git-diff-content.outputs.diff | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'governor/proto' | |
if: steps.git-diff-governor.outputs.diff | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'subject/proto' | |
if: steps.git-diff-subject.outputs.diff | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'validator/proto' | |
if: steps.git-diff-validator.outputs.diff | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: 'voucher/proto' | |
if: steps.git-diff-voucher.outputs.diff | |
protolint: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read # for technote-space/get-diff-action to get git reference | |
strategy: | |
matrix: | |
module: ["admin", "content", "governor", "subject", "validator", "voucher"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-admin | |
with: | |
PATTERNS: | | |
admin/**/**.proto | |
if: matrix.module == 'admin' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-content | |
with: | |
PATTERNS: | | |
content/**/**.proto | |
if: matrix.module == 'content' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-governor | |
with: | |
PATTERNS: | | |
governor/**/**.proto | |
if: matrix.module == 'governor' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-subject | |
with: | |
PATTERNS: | | |
subject/**/**.proto | |
if: matrix.module == 'subject' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-validator | |
with: | |
PATTERNS: | | |
validator/**/**.proto | |
if: matrix.module == 'validator' | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff-voucher | |
with: | |
PATTERNS: | | |
voucher/**/**.proto | |
if: matrix.module == 'voucher' | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'admin/go.mod' | |
if: steps.git-diff-admin.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'content/go.mod' | |
if: steps.git-diff-content.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'governor/go.mod' | |
if: steps.git-diff-governor.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'subject/go.mod' | |
if: steps.git-diff-subject.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'validator/go.mod' | |
if: steps.git-diff-validator.outputs.diff | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'voucher/go.mod' | |
if: steps.git-diff-voucher.outputs.diff | |
- name: Install protolint | |
run: go install github.com/yoheimuta/protolint/cmd/protolint@latest | |
if: | | |
steps.git-diff-admin.outputs.diff || | |
steps.git-diff-content.outputs.diff || | |
steps.git-diff-governor.outputs.diff || | |
steps.git-diff-subject.outputs.diff || | |
steps.git-diff-validator.outputs.diff || | |
steps.git-diff-voucher.outputs.diff | |
- name: Run protolint | |
run: protolint ./admin | |
if: steps.git-diff-admin.outputs.diff | |
- name: Run protolint | |
run: protolint ./content | |
if: steps.git-diff-content.outputs.diff | |
- name: Run protolint | |
run: protolint ./governor | |
if: steps.git-diff-governor.outputs.diff | |
- name: Run protolint | |
run: protolint ./subject | |
if: steps.git-diff-subject.outputs.diff | |
- name: Run protolint | |
run: protolint ./validator | |
if: steps.git-diff-validator.outputs.diff | |
- name: Run protolint | |
run: protolint ./voucher | |
if: steps.git-diff-voucher.outputs.diff |