-
Notifications
You must be signed in to change notification settings - Fork 0
Add CI to verify that the library is buildable and correct on style and format #34
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 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bef035c
ci: add ci to verify the library is buildable and correct on style an…
yukicoder0509 46d83c3
fix: update go version in workflow to 1.26
yukicoder0509 780a211
fix: when testing cli scaffold, direct the build output elsewhere to …
yukicoder0509 63e6b47
fix: use go 1.26 in all CI jobs
yukicoder0509 1a52df2
ci: update the actions in CI workflow to prevent depending on the dep…
yukicoder0509 7e36501
chore: add basic setting of golangci-lint to run linter and formatter
yukicoder0509 f994d51
ci: run go vet and gofmt together with golangci-lint
yukicoder0509 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,56 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: 1.26 | ||
| - run: go build ./... | ||
|
|
||
| vet: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: 1.26 | ||
| - run: go vet ./... | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: 1.26 | ||
| - run: gofmt -l . | tee /tmp/fmt.txt && test ! -s /tmp/fmt.txt | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: 1.26 | ||
| - run: go test ./... -race -cover | ||
|
|
||
| cli-scaffold: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: 1.26 | ||
| - name: CLI scaffolds a buildable project | ||
| run: | | ||
| go build -o /tmp/summer ./cmd/summer | ||
| cd $(mktemp -d) | ||
| /tmp/summer -b main init <<< "testproject" | ||
| go mod tidy | ||
| go build -o /tmp/build/ ./... | ||
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.