Skip to content

Commit 750bf92

Browse files
committed
adds GHA & Makefile configs
1 parent b2c246b commit 750bf92

13 files changed

+224
-136
lines changed

.circleci/config.yml

-70
This file was deleted.

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
insert_final_newline = true
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
indent_style = space
10+
indent_size = 2
11+
12+
[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
13+
indent_style = tab
14+
indent_size = 4
15+
16+
[*.md]
17+
indent_size = 4
18+
trim_trailing_whitespace = false
19+
20+
eclint_indent_style = unset

.github/release-drafter.yml

-7
This file was deleted.

.github/workflows/issues.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add all the issues created to the project.
2+
name: Add issue or pull request to Project
3+
4+
on:
5+
issues:
6+
types:
7+
- opened
8+
pull_request_target:
9+
types:
10+
- opened
11+
- reopened
12+
13+
jobs:
14+
add-to-project:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Add issue to project
18+
uses: actions/[email protected]
19+
with:
20+
project-url: https://github.com/orgs/gorilla/projects/4
21+
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}

.github/workflows/security.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Security
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
jobs:
12+
scan:
13+
strategy:
14+
matrix:
15+
go: ['1.20','1.21']
16+
fail-fast: true
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Go ${{ matrix.go }}
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: ${{ matrix.go }}
26+
cache: false
27+
28+
- name: Run GoSec
29+
uses: securego/gosec@master
30+
with:
31+
args: -exclude-dir examples ./...
32+
33+
- name: Run GoVulnCheck
34+
uses: golang/govulncheck-action@v1
35+
with:
36+
go-version-input: ${{ matrix.go }}
37+
go-package: ./...

.github/workflows/test.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
jobs:
12+
unit:
13+
strategy:
14+
matrix:
15+
go: ['1.20','1.21']
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
fail-fast: true
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v3
22+
23+
- name: Setup Go ${{ matrix.go }}
24+
uses: actions/setup-go@v4
25+
with:
26+
go-version: ${{ matrix.go }}
27+
cache: false
28+
29+
- name: Run Tests
30+
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...
31+
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@v3
34+
with:
35+
files: ./coverage

.github/workflows/verify.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Verify
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
jobs:
12+
lint:
13+
strategy:
14+
matrix:
15+
go: ['1.20','1.21']
16+
fail-fast: true
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Go ${{ matrix.go }}
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: ${{ matrix.go }}
26+
cache: false
27+
28+
- name: Run GolangCI-Lint
29+
uses: golangci/golangci-lint-action@v3
30+
with:
31+
version: v1.53

.gitignore

+1-25
Original file line numberDiff line numberDiff line change
@@ -1,25 +1 @@
1-
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2-
*.o
3-
*.a
4-
*.so
5-
6-
# Folders
7-
_obj
8-
_test
9-
10-
# Architecture specific extensions/prefixes
11-
*.[568vq]
12-
[568vq].out
13-
14-
*.cgo1.go
15-
*.cgo2.c
16-
_cgo_defun.c
17-
_cgo_gotypes.go
18-
_cgo_export.*
19-
20-
_testmain.go
21-
22-
*.exe
23-
24-
.idea/
25-
*.iml
1+
coverage.coverprofile

.golangci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
run:
2+
timeout: "5m"
3+
# will not run golangci-lint against *_test.go
4+
tests: false
5+
issues:
6+
exclude-dirs:
7+
- examples/*.go
8+
exclude-rules:
9+
# excluding error checks from all the .go files
10+
- path: ./*.go
11+
linters:
12+
- errcheck
13+

AUTHORS

-9
This file was deleted.

LICENSE

+23-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.
1+
Copyright (c) 2023 The Gorilla Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without
4-
modification, are permitted provided that the following conditions are met:
4+
modification, are permitted provided that the following conditions are
5+
met:
56

6-
Redistributions of source code must retain the above copyright notice, this
7-
list of conditions and the following disclaimer.
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following disclaimer
11+
in the documentation and/or other materials provided with the
12+
distribution.
13+
* Neither the name of Google Inc. nor the names of its
14+
contributors may be used to endorse or promote products derived from
15+
this software without specific prior written permission.
816

9-
Redistributions in binary form must reproduce the above copyright notice,
10-
this list of conditions and the following disclaimer in the documentation
11-
and/or other materials provided with the distribution.
12-
13-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '')
2+
GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest
3+
4+
GO_SEC=$(shell which gosec 2> /dev/null || echo '')
5+
GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest
6+
7+
GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '')
8+
GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest
9+
10+
.PHONY: golangci-lint
11+
golangci-lint:
12+
$(if $(GO_LINT), ,go install $(GO_LINT_URI))
13+
@echo "##### Running golangci-lint"
14+
golangci-lint run -v
15+
16+
.PHONY: gosec
17+
gosec:
18+
$(if $(GO_SEC), ,go install $(GO_SEC_URI))
19+
@echo "##### Running gosec"
20+
gosec -exclude-dir examples ./...
21+
22+
.PHONY: govulncheck
23+
govulncheck:
24+
$(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI))
25+
@echo "##### Running govulncheck"
26+
govulncheck ./...
27+
28+
.PHONY: verify
29+
verify: golangci-lint gosec govulncheck
30+
31+
.PHONY: test
32+
test:
33+
@echo "##### Running tests"
34+
go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./...

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# Gorilla WebSocket
1+
# gorilla/websocket
22

3-
[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket)
4-
[![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket)
3+
![testing](https://github.com/gorilla/websocket/actions/workflows/test.yml/badge.svg)
4+
[![codecov](https://codecov.io/github/gorilla/websocket/branch/main/graph/badge.svg)](https://codecov.io/github/gorilla/websocket)
5+
[![godoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket)
6+
[![sourcegraph](https://sourcegraph.com/github.com/gorilla/websocket/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/websocket?badge)
57

6-
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
7-
[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol.
8+
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol.
9+
10+
![Gorilla Logo](https://github.com/gorilla/.github/assets/53367916/d92caabf-98e0-473e-bfbf-ab554ba435e5)
811

912

1013
### Documentation
@@ -30,5 +33,4 @@ package API is stable.
3033

3134
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
3235
Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn
33-
subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn).
34-
36+
subdirectory](https://github.com/gorilla/websocket/tree/main/examples/autobahn).

0 commit comments

Comments
 (0)