update GitHub workflows (#857)

<!--
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)

- [x] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Go Version Update
- [ ] Dependency 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

- [x] `make verify` is passing
- [x] `make test` is passing
This commit is contained in:
Corey Daley 2023-10-18 08:27:41 -04:00 committed by GitHub
parent 78c34874c8
commit ac0789be11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 74 additions and 25 deletions

View File

@ -1,4 +1,4 @@
# Add issues or pull-requests created to the project. # Add all the issues created to the project.
name: Add issue or pull request to Project name: Add issue or pull request to Project
on: on:

37
.github/workflows/security.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Security
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
scan:
strategy:
matrix:
go: ['1.20','1.21']
fail-fast: true
runs-on: ubuntu-latest
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 GoSec
uses: securego/gosec@master
with:
args: -exclude-dir examples ./...
- name: Run GoVulnCheck
uses: golang/govulncheck-action@v1
with:
go-version-input: ${{ matrix.go }}
go-package: ./...

View File

@ -1,4 +1,4 @@
name: CI name: Test
on: on:
push: push:
branches: branches:
@ -6,15 +6,13 @@ on:
pull_request: pull_request:
branches: branches:
- main - main
permissions: permissions:
contents: read contents: read
jobs: jobs:
verify-and-test: unit:
strategy: strategy:
matrix: matrix:
go: ['1.19','1.20'] go: ['1.20','1.21']
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true fail-fast: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -28,24 +26,6 @@ jobs:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
cache: false 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: -exclude-dir examples ./...
- name: Run GoVulnCheck
uses: golang/govulncheck-action@v1
with:
go-version-input: ${{ matrix.go }}
go-package: ./...
- name: Run Tests - name: Run Tests
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./... run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...

32
.github/workflows/verify.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Verify
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
lint:
strategy:
matrix:
go: ['1.20','1.21']
fail-fast: true
runs-on: ubuntu-latest
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

2
go.mod
View File

@ -1,5 +1,5 @@
module github.com/gorilla/websocket module github.com/gorilla/websocket
go 1.19 go 1.20
require golang.org/x/net v0.17.0 require golang.org/x/net v0.17.0