-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
<!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments. Before submitting a Pull Request, please ensure that you have: - 📖 Read the Contributing guide: https://github.com/gorilla/.github/blob/main/CONTRIBUTING.md - 📖 Read the Code of Conduct: https://github.com/gorilla/.github/blob/main/CODE_OF_CONDUCT.md - Provide tests for your changes. - Use descriptive commit messages. - Comment your code where appropriate. - Squash your commits - Update any related documentation. - Add gorilla/pull-request-reviewers as a Reviewer --> ## What type of PR is this? (check all applicable) - [ ] Refactor - [ ] Feature - [ ] Bug Fix - [x] Optimization - [ ] Documentation Update ## Description ## Related Tickets & Documents <!-- For pull requests that relate or close an issue, please include them below. We like to follow [Github's guidance on linking issues to pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). For example having the text: "closes #1234" would connect the current pull request to issue 1234. And when we merge the pull request, Github will automatically close the issue. --> - Related Issue # - Closes # ## Added/updated tests? - [ ] Yes - [ ] No, and this is why: _please replace this line with details on why tests have not been included_ - [ ] I need help with writing tests ## Run verifications and test - [ ] `make verify` is passing - [ ] `make test` is passing
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; https://editorconfig.org/ | ||
|
||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[{Makefile,go.mod,go.sum,*.go,.gitmodules}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[*.md] | ||
indent_size = 4 | ||
trim_trailing_whitespace = false | ||
|
||
eclint_indent_style = unset |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add issues or pull-requests created to the project. | ||
name: Add issue or pull request to Project | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
|
||
jobs: | ||
add-to-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add issue to project | ||
uses: actions/add-to-project@v0.5.0 | ||
with: | ||
project-url: https://github.com/orgs/gorilla/projects/4 | ||
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
verify-and-test-and-fuzz: | ||
strategy: | ||
matrix: | ||
go: ['1.19','1.20'] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
fail-fast: true | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go ${{ matrix.go }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
cache: false | ||
|
||
- name: Run GolangCI-Lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.53 | ||
args: --timeout=5m | ||
|
||
- name: Run GoSec | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: securego/gosec@master | ||
with: | ||
args: ./... | ||
|
||
- name: Run GoVulnCheck | ||
uses: golang/govulncheck-action@v1 | ||
with: | ||
go-version-input: ${{ matrix.go }} | ||
go-package: ./... | ||
|
||
- name: Run Tests | ||
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./... | ||
|
||
- name: Run Fuzz Tests | ||
run: go test -v -fuzz FuzzEncodeDecode -fuzztime 60s | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage.coverprofile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '') | ||
GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
|
||
GO_SEC=$(shell which gosec 2> /dev/null || echo '') | ||
GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest | ||
|
||
GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '') | ||
GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest | ||
|
||
.PHONY: golangci-lint | ||
golangci-lint: | ||
$(if $(GO_LINT), ,go install $(GO_LINT_URI)) | ||
@echo "##### Running golangci-lint" | ||
golangci-lint run -v | ||
|
||
.PHONY: gosec | ||
gosec: | ||
$(if $(GO_SEC), ,go install $(GO_SEC_URI)) | ||
@echo "##### Running gosec" | ||
gosec ./... | ||
|
||
.PHONY: govulncheck | ||
govulncheck: | ||
$(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI)) | ||
@echo "##### Running govulncheck" | ||
govulncheck ./... | ||
|
||
.PHONY: verify | ||
verify: golangci-lint gosec govulncheck | ||
|
||
.PHONY: test | ||
test: | ||
@echo "##### Running tests" | ||
go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./... | ||
|
||
.PHONY: fuzz | ||
fuzz: | ||
@echo "##### Running fuzz tests" | ||
go test -v -fuzz FuzzEncodeDecode -fuzztime 60s |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.