-
Notifications
You must be signed in to change notification settings - Fork 20
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
#8 Setting up CI checks via GH Actions #31
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
38c56a2
#8 Setting up CI checks via GH Actions
roma-glushko 35b37d7
#8 Fixing lint errors in the existing codebase
roma-glushko 9a92375
#8 Fixed remaining lint errors
roma-glushko e0cd143
#8 Installed tools via makefile, merged tests with the lint yaml
roma-glushko 8073790
#8 Disabled troublesome checks
roma-glushko 9cd36d6
#8 fixing the minor version for gosec
roma-glushko 64be80c
#8 Run gosec directly in the job
roma-glushko 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 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,100 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: ["main", "develop"] | ||
pull_request: | ||
branches: ["main", "develop"] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
check-latest: true | ||
|
||
- name: Install | ||
run: go install mvdan.cc/gofumpt@latest | ||
|
||
- name: Go Format | ||
run: gofmt -s -w . && git diff --exit-code | ||
|
||
- name: Gofumpt | ||
run: gofumpt -l -w . && git diff --exit-code | ||
|
||
- name: Go Vet | ||
run: go vet ./... | ||
|
||
- name: Go Tidy | ||
run: go mod tidy && git diff --exit-code | ||
|
||
- name: Go Mod | ||
run: go mod download | ||
|
||
- name: Go Mod Verify | ||
run: go mod verify | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
check-latest: true | ||
- name: Build | ||
run: go build -v ./... | ||
|
||
static-checks: | ||
name: Static Checks | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
check-latest: true | ||
|
||
- name: Install staticcheck | ||
run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||
|
||
- name: Install nilaway | ||
run: go install go.uber.org/nilaway/cmd/nilaway@latest | ||
|
||
- name: GolangCILint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
args: --timeout 5m | ||
|
||
- name: Staticcheck | ||
run: staticcheck ./... | ||
# TODO: Ignore the issue in https://github.com/modelgateway/Glide/issues/32 | ||
# - name: Nilaway | ||
# run: nilaway ./... | ||
|
||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
check-latest: true | ||
|
||
- name: Test | ||
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: security | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
|
||
pull_request: | ||
branches: [main, develop] | ||
|
||
schedule: | ||
- cron: '0 10 * * 1' # run "At 10:00 on Monday" | ||
|
||
jobs: | ||
run: | ||
name: Vulnerability Check | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21.5' | ||
check-latest: true | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install govulncheck | ||
run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
|
||
- name: Install gosec | ||
run: go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
|
||
- name: Govulncheck | ||
run: govulncheck -test ./... | ||
|
||
- name: Govulncheck | ||
run: gosec ./... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.idea | ||
dist | ||
.env | ||
bin | ||
glide | ||
tmp | ||
coverage.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
output: | ||
# Make output more digestible with quickfix in vim/emacs/etc. | ||
sort-results: true | ||
print-issued-lines: false | ||
|
||
linters: | ||
enable: | ||
- nolintlint | ||
- revive | ||
- staticcheck | ||
|
||
linters-settings: | ||
govet: | ||
# These govet checks are disabled by default, but they're useful. | ||
enable: | ||
- niliness | ||
- reflectvaluecompare | ||
- sortslice | ||
- unusedwrite |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
_ "go.uber.org/goleak" | ||
) | ||
|
||
// TODO: investigate why netpoll leaves pending goroutines | ||
// https://github.com/modelgateway/Glide/issues/33 | ||
//func TestMain(m *testing.M) { | ||
// goleak.VerifyTestMain(m) | ||
//} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
package main | ||
|
||
import ( | ||
"glide/pkg/cmd" | ||
"log" | ||
|
||
"glide/pkg/cmd" | ||
) | ||
|
||
func main() { | ||
|
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a committed binary in the dev branch cc @mkrueger12