-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating to go1.19, adding github actions
- Loading branch information
1 parent
956d3cf
commit 148980f
Showing
13 changed files
with
184 additions
and
140 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
# Add all the issues created to the project. | ||
name: Add all issues to Project | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
pull_request: | ||
types: | ||
- opened | ||
|
||
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 }} |
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,30 @@ | ||
name: Pull request size labeler | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
labeler: | ||
runs-on: ubuntu-latest | ||
name: Label the PR size | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: codelytv/pr-size-labeler@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_TOKEN }} | ||
xs_label: 'size/xs' | ||
xs_max_size: '10' | ||
s_label: 'size/s' | ||
s_max_size: '100' | ||
m_label: 'size/m' | ||
m_max_size: '500' | ||
l_label: 'size/l' | ||
l_max_size: '1000' | ||
xl_label: 'size/xl' | ||
fail_if_xl: 'false' | ||
message_if_xl: > | ||
This PR exceeds the recommended size of 1000 lines. | ||
Please make sure you are NOT addressing multiple issues with one PR. | ||
Note this PR might be rejected due to its size. | ||
files_to_ignore: '' |
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,55 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
verify-and-test: | ||
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: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage |
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 @@ | ||
coverage.coverprofile |
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,70 @@ | ||
SHELL := /bin/bash | ||
|
||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) | ||
ifeq (,$(shell go env GOBIN)) | ||
GOBIN=$(shell go env GOPATH)/bin | ||
else | ||
GOBIN=$(shell go env GOBIN) | ||
endif | ||
|
||
# LINT is the path to the golangci-lint binary | ||
GOLINT = $(shell which golangci-lint) | ||
|
||
.PHONY: golangci-lint | ||
golangci-lint: | ||
ifeq (, $(GOLINT)) | ||
ifeq (, $(shell which golangci-lint)) | ||
@{ \ | ||
set -e ;\ | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest ;\ | ||
} | ||
override GOLINT=$(GOBIN)/golangci-lint | ||
else | ||
override GOLINT=$(shell which golangci-lint) | ||
endif | ||
endif | ||
$(GOLINT) run | ||
|
||
# GOSEC is the path to the gosec binary | ||
GOSEC = $(shell which gosec) | ||
|
||
.PHONY: gosec | ||
gosec: | ||
ifeq (, $(GOSEC)) | ||
ifeq (, $(shell which gosec)) | ||
@{ \ | ||
set -e ;\ | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest ;\ | ||
} | ||
override GOSEC=$(GOBIN)/gosec | ||
else | ||
override GOSEC=$(shell which gosec) | ||
endif | ||
endif | ||
$(GOSEC) ./... | ||
|
||
# GOVULNCHECK is the path to the govulncheck binary | ||
GOVULNCHECK = $(shell which govulncheck) | ||
|
||
.PHONY: govulncheck | ||
govulncheck: | ||
ifeq (, $(GOVULNCHECK)) | ||
ifeq (, $(shell which govulncheck)) | ||
@{ \ | ||
set -e ;\ | ||
go install golang.org/x/vuln/cmd/govulncheck@latest ;\ | ||
} | ||
override GOVULNCHECK=$(GOBIN)/govulncheck | ||
else | ||
override GOVULNCHECK=$(shell which govulncheck) | ||
endif | ||
endif | ||
$(GOVULNCHECK) ./... | ||
|
||
.PHONY: verify | ||
verify: golangci-lint gosec govulncheck | ||
|
||
|
||
.PHONY: test | ||
test: | ||
go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./... |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/gorilla/sessions | ||
|
||
go 1.19 | ||
|
||
require github.com/gorilla/securecookie v1.1.1 |
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