Skip to content

Commit 9dff76b

Browse files
authored
update GitHub workflows (#205)
<!-- 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
1 parent 5fca2dc commit 9dff76b

File tree

5 files changed

+75
-26
lines changed

5 files changed

+75
-26
lines changed

.github/workflows/issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Add issues or pull-requests created to the project.
1+
# Add all the issues created to the project.
22
name: Add issue or pull request to Project
33

44
on:

.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

+4-24
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
name: CI
1+
name: Test
22
on:
33
push:
44
branches:
55
- main
66
pull_request:
77
branches:
88
- main
9-
109
permissions:
1110
contents: read
12-
1311
jobs:
14-
verify-and-test:
12+
unit:
1513
strategy:
1614
matrix:
17-
go: ['1.19','1.20']
15+
go: ['1.20','1.21']
1816
os: [ubuntu-latest, macos-latest, windows-latest]
1917
fail-fast: true
2018
runs-on: ${{ matrix.os }}
@@ -28,28 +26,10 @@ jobs:
2826
go-version: ${{ matrix.go }}
2927
cache: false
3028

31-
- name: Run GolangCI-Lint
32-
uses: golangci/golangci-lint-action@v3
33-
with:
34-
version: v1.53
35-
args: --timeout=5m
36-
37-
- name: Run GoSec
38-
if: matrix.os == 'ubuntu-latest'
39-
uses: securego/gosec@master
40-
with:
41-
args: ./...
42-
43-
- name: Run GoVulnCheck
44-
uses: golang/govulncheck-action@v1
45-
with:
46-
go-version-input: ${{ matrix.go }}
47-
go-package: ./...
48-
4929
- name: Run Tests
5030
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...
5131

5232
- name: Upload coverage to Codecov
5333
uses: codecov/codecov-action@v3
5434
with:
55-
files: ./coverage
35+
files: ./coverage

.github/workflows/verify.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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
32+
args: --timeout=5m

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/gorilla/schema
22

3-
go 1.19
3+
go 1.20

0 commit comments

Comments
 (0)