aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/issues.yml21
-rw-r--r--.github/workflows/test.yml58
2 files changed, 79 insertions, 0 deletions
diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml
new file mode 100644
index 0000000..2a38d75
--- /dev/null
+++ b/.github/workflows/issues.yml
@@ -0,0 +1,21 @@
+# Add issues or pull-requests created to the project.
+name: Add issue or pull request to Project
+
+on:
+ issues:
+ types:
+ - opened
+ pull_request_target:
+ types:
+ - opened
+ - reopened
+
+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 }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..e6121cf
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,58 @@
+name: CI
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+permissions:
+ contents: read
+
+jobs:
+ verify-and-test-and-fuzz:
+ 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: Run Fuzz Tests
+ run: go test -v -fuzz FuzzEncodeDecode -fuzztime 60s
+
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v3
+ with:
+ files: ./coverage