-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore(wren-launcher): add CI flow and apply lint tools #1877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
af26801
add code quality tools
goldmedal 642da05
fix lint and format
goldmedal b68fa06
add ci workflow
goldmedal f647b44
fix label
goldmedal 950c3d7
comment in english
goldmedal 91975b9
fix ci
goldmedal 1ec6b11
fix ci
goldmedal 56463ac
upgrade go version and fix ci flow
goldmedal c1c39bf
fix ci and lint version
goldmedal fa07424
run dbt test only for ci
goldmedal 7b1e98a
fix security scan ci
goldmedal 67cdaee
remove test build
goldmedal 5f74f55
remove build-test
goldmedal 5b9f637
remove unused tag
goldmedal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Wren Launcher CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [synchronize, labeled] | ||
| paths: | ||
| - 'wren-launcher/**' | ||
| - '.github/workflows/wren-launcher-ci.yaml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: wren-launcher | ||
|
|
||
| jobs: | ||
| golangci: | ||
| name: lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| cache-dependency-path: wren-launcher/go.sum | ||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v8 | ||
| with: | ||
| version: v2.3.1 | ||
| working-directory: wren-launcher | ||
|
|
||
| fmt-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| cache-dependency-path: wren-launcher/go.sum | ||
| - name: Install goimports | ||
| run: go install golang.org/x/tools/cmd/goimports@latest | ||
| - name: Download dependencies | ||
| run: go mod download | ||
| - name: Run format check | ||
| run: | | ||
| make fmt | ||
| # Check if there are any formatting changes | ||
| if [ -n "$(git diff --name-only)" ]; then | ||
| echo "Code is not formatted properly. Please run 'make fmt' and commit the changes." | ||
| git diff | ||
| exit 1 | ||
| fi | ||
| - name: Run go vet | ||
| run: make vet | ||
| - name: Run tests | ||
| run: go test ./commands/dbt | ||
|
|
||
goldmedal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| security-scan: | ||
| runs-on: ubuntu-latest | ||
| needs: fmt-and-test | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| cache-dependency-path: wren-launcher/go.sum | ||
| - name: Run Gosec Security Scanner | ||
| run: | | ||
| go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
| gosec ./... | ||
| - name: Run Go mod audit | ||
| run: | | ||
| go mod verify | ||
| go list -json -deps ./... | jq -r '.Module | select(.Version) | "\(.Path) \(.Version)"' | sort -u | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # golangci-lint configuration for WrenAI wren-launcher | ||
| version: "2" | ||
|
|
||
| run: | ||
| timeout: 5m | ||
|
|
||
| linters: | ||
| enable: | ||
| - errcheck | ||
| - govet | ||
| - ineffassign | ||
| - staticcheck | ||
| - unused | ||
| - misspell | ||
| - unconvert | ||
| - gosec | ||
| - dupl | ||
| - goconst | ||
| - gocyclo | ||
| - bodyclose | ||
| - whitespace | ||
|
|
||
| issues: | ||
| max-issues-per-linter: 0 | ||
| max-same-issues: 0 |
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.