-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #8 Setting up CI checks via GH Actions * #8 Fixing lint errors in the existing codebase * #8 Fixed remaining lint errors * #8 Installed tools via makefile, merged tests with the lint yaml * #8 Disabled troublesome checks * #8 fixing the minor version for gosec * #8 Run gosec directly in the job
- Loading branch information
1 parent
86c624c
commit 99ab0dc
Showing
19 changed files
with
274 additions
and
72 deletions.
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.