mirror of https://github.com/gorilla/sessions
Browse Source
Fixes # **Summary of Changes** 1. 2. 3. > PS: Make sure your PR includes/updates tests! If you need help with this part, just ask!pull/264/head
Corey Daley
1 year ago
committed by
GitHub
13 changed files with 138 additions and 140 deletions
@ -1,70 +0,0 @@
|
||||
version: 2.1 |
||||
|
||||
jobs: |
||||
"test": |
||||
parameters: |
||||
version: |
||||
type: string |
||||
default: "latest" |
||||
golint: |
||||
type: boolean |
||||
default: true |
||||
modules: |
||||
type: boolean |
||||
default: true |
||||
goproxy: |
||||
type: string |
||||
default: "" |
||||
docker: |
||||
- image: "circleci/golang:<< parameters.version >>" |
||||
working_directory: /go/src/github.com/gorilla/sessions |
||||
environment: |
||||
GO111MODULE: "on" |
||||
GOPROXY: "<< parameters.goproxy >>" |
||||
steps: |
||||
- checkout |
||||
- run: |
||||
name: "Print the Go version" |
||||
command: > |
||||
go version |
||||
- run: |
||||
name: "Fetch dependencies" |
||||
command: > |
||||
if [[ << parameters.modules >> = true ]]; then |
||||
go mod download |
||||
export GO111MODULE=on |
||||
else |
||||
go get -v ./... |
||||
fi |
||||
# Only run gofmt, vet & lint against the latest Go version |
||||
- run: |
||||
name: "Run golint" |
||||
command: > |
||||
if [ << parameters.version >> = "latest" ] && [ << parameters.golint >> = true ]; then |
||||
go get -u golang.org/x/lint/golint |
||||
golint ./... |
||||
fi |
||||
- run: |
||||
name: "Run gofmt" |
||||
command: > |
||||
if [[ << parameters.version >> = "latest" ]]; then |
||||
diff -u <(echo -n) <(gofmt -d -e .) |
||||
fi |
||||
- run: |
||||
name: "Run go vet" |
||||
command: > |
||||
if [[ << parameters.version >> = "latest" ]]; then |
||||
go vet -v ./... |
||||
fi |
||||
- run: |
||||
name: "Run go test (+ race detector)" |
||||
command: > |
||||
go test -v -race ./... |
||||
|
||||
workflows: |
||||
tests: |
||||
jobs: |
||||
- test: |
||||
matrix: |
||||
parameters: |
||||
version: ["latest", "1.15", "1.14", "1.13", "1.12", "1.11"] |
@ -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 |
@ -1,8 +0,0 @@
|
||||
# Config for https://github.com/apps/release-drafter |
||||
template: | |
||||
|
||||
<summary of changes here> |
||||
|
||||
### CHANGELOG |
||||
|
||||
$CHANGES |
@ -1,12 +0,0 @@
|
||||
daysUntilStale: 60 |
||||
daysUntilClose: 7 |
||||
# Issues with these labels will never be considered stale |
||||
exemptLabels: |
||||
- v2 |
||||
- needs-review |
||||
- work-required |
||||
staleLabel: stale |
||||
markComment: > |
||||
This issue has been automatically marked as stale because it hasn't seen |
||||
a recent update. It'll be automatically closed in a few days. |
||||
closeComment: false |
@ -0,0 +1,20 @@
|
||||
# Add all the issues created to the project. |
||||
name: Add issue or pull request 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 }} |
@ -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 |
@ -1,43 +0,0 @@
|
||||
# This is the official list of gorilla/sessions authors for copyright purposes. |
||||
# |
||||
# Please keep the list sorted. |
||||
|
||||
Ahmadreza Zibaei <ahmadrezazibaei@hotmail.com> |
||||
Anton Lindström <lindztr@gmail.com> |
||||
Brian Jones <mojobojo@gmail.com> |
||||
Collin Stedman <kronion@users.noreply.github.com> |
||||
Deniz Eren <dee.116@gmail.com> |
||||
Dmitry Chestnykh <dmitry@codingrobots.com> |
||||
Dustin Oprea <myselfasunder@gmail.com> |
||||
Egon Elbre <egonelbre@gmail.com> |
||||
enumappstore <appstore@enumapps.com> |
||||
Geofrey Ernest <geofreyernest@live.com> |
||||
Google LLC (https://opensource.google.com/) |
||||
Jerry Saravia <SaraviaJ@gmail.com> |
||||
Jonathan Gillham <jonathan.gillham@gamil.com> |
||||
Justin Clift <justin@postgresql.org> |
||||
Justin Hellings <justin.hellings@gmail.com> |
||||
Kamil Kisiel <kamil@kamilkisiel.net> |
||||
Keiji Yoshida <yoshida.keiji.84@gmail.com> |
||||
kliron <kliron@gmail.com> |
||||
Kshitij Saraogi <KshitijSaraogi@gmail.com> |
||||
Lauris BH <lauris@nix.lv> |
||||
Lukas Rist <glaslos@gmail.com> |
||||
Mark Dain <ancarda@users.noreply.github.com> |
||||
Matt Ho <matt.ho@gmail.com> |
||||
Matt Silverlock <matt@eatsleeprepeat.net> |
||||
Mattias Wadman <mattias.wadman@gmail.com> |
||||
Michael Schuett <michaeljs1990@gmail.com> |
||||
Michael Stapelberg <stapelberg@users.noreply.github.com> |
||||
Mirco Zeiss <mirco.zeiss@gmail.com> |
||||
moraes <rodrigo.moraes@gmail.com> |
||||
nvcnvn <nguyen@open-vn.org> |
||||
pappz <zoltan.pmail@gmail.com> |
||||
Pontus Leitzler <leitzler@users.noreply.github.com> |
||||
QuaSoft <info@quasoft.net> |
||||
rcadena <robert.cadena@gmail.com> |
||||
rodrigo moraes <rodrigo.moraes@gmail.com> |
||||
Shawn Smith <shawnpsmith@gmail.com> |
||||
Taylor Hurt <taylor.a.hurt@gmail.com> |
||||
Tortuoise <sanyasinp@gmail.com> |
||||
Vitor De Mario <vitordemario@gmail.com> |
@ -0,0 +1,34 @@
|
||||
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 ./...
|
@ -1,3 +1,5 @@
|
||||
module github.com/gorilla/sessions |
||||
|
||||
go 1.19 |
||||
|
||||
require github.com/gorilla/securecookie v1.1.1 |
||||
|
Loading…
Reference in new issue