chore: add golangci-lint CI workflow and fix existing linting issues #468
Workflow file for this run
This file contains hidden or 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: Build model-cli | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'cmd/cli/**' | |
| - '.github/workflows/cli-build.yml' | |
| pull_request: | |
| branches: [ "main" ] | |
| paths: | |
| - 'cmd/cli/**' | |
| - '.github/workflows/cli-build.yml' | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Branch" | |
| required: true | |
| default: "main" | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 | |
| - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c | |
| with: | |
| go-version-file: cmd/cli/go.mod | |
| cache: true | |
| cache-dependency-path: cmd/cli/go.sum | |
| - name: Build model-cli | |
| working-directory: cmd/cli | |
| run: | | |
| make release VERSION=${{ github.sha }} | |
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 | |
| with: | |
| name: dist | |
| path: | | |
| cmd/cli/dist/ | |
| retention-days: 2 | |
| if-no-files-found: error |