Skip to content

Commit

Permalink
fix: missing lint job in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Nov 11, 2024
1 parent d4adfd5 commit f9682df
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,52 @@ permissions:
# pull-requests: read

jobs:
lint-go-project:
name: "lint: ${{ inputs.project-directory }}"
runs-on: 'ubuntu-latest'
continue-on-error: false
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version-file: "${{ inputs.project-directory == '' && '.' || inputs.project-directory }}/go.mod"
cache-dependency-path: "${{ inputs.project-directory == '' && '.' || inputs.project-directory }}/go.sum"
id: go

- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
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: v1.61.0
# Optional: working directory, useful for monorepos
working-directory: ${{ inputs.project-directory }}
# Optional: golangci-lint command line arguments.
args: --verbose
# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
skip-cache: true

- name: generate
working-directory: ./${{ inputs.project-directory }}
shell: bash
run: |
make generate
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
- name: modVerify
working-directory: ./${{ inputs.project-directory }}
run: go mod verify

- name: modTidy
working-directory: ./${{ inputs.project-directory }}
shell: bash
run: |
make tidy
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
test-go-project:
name: "test: ${{ inputs.project-directory }}/${{ inputs.go-version }}"
# Modulegen can run the tests on all platforms
Expand Down

0 comments on commit f9682df

Please sign in to comment.