Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
109 changed files
with
7,124 additions
and
3,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
- With pull requests: | ||
- Open your pull request against `master` | ||
- Your pull request should have no more than two commits, if not you should squash them. | ||
- It should pass all tests in the available continuous integration systems such as TravisCI. | ||
- It should pass all tests in the available continuous integration systems such as GitHub Actions. | ||
- You should add/modify tests to cover your proposed code changes. | ||
- If your pull request contains a new feature, please document it on the README. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
- package-ecosystem: gomod | ||
directory: / | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ master ] | ||
schedule: | ||
- cron: '0 17 * * 5' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Override automatic language detection by changing the below list | ||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] | ||
# TODO: Enable for javascript later | ||
language: [ 'go'] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '^1.16' | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup golangci-lint | ||
uses: golangci/golangci-lint-action@v3.3.1 | ||
with: | ||
version: v1.48.0 | ||
args: --verbose | ||
test: | ||
needs: lint | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
go: [1.16, 1.17, 1.18, 1.19] | ||
test-tags: ['', '-tags nomsgpack', '-tags "sonic avx"', '-tags go_json'] | ||
include: | ||
- os: ubuntu-latest | ||
go-build: ~/.cache/go-build | ||
- os: macos-latest | ||
go-build: ~/Library/Caches/go-build | ||
name: ${{ matrix.os }} @ Go ${{ matrix.go }} ${{ matrix.test-tags }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GO111MODULE: on | ||
TESTTAGS: ${{ matrix.test-tags }} | ||
GOPROXY: https://proxy.golang.org | ||
steps: | ||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ matrix.go-build }} | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run Tests | ||
run: make test | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
flags: ${{ matrix.os }},go-${{ matrix.go }},${{ matrix.test-tags }} | ||
|
||
- name: Format | ||
if: matrix.go-version == '1.19.x' | ||
run: diff -u <(echo -n) <(gofmt -d .) | ||
notification-gitter: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notification failure message | ||
if: failure() | ||
run: | | ||
PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)" | ||
curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" -d level=error https://webhooks.gitter.im/e/7f95bf605c4d356372f4 | ||
- name: Notification success message | ||
if: success() | ||
run: | | ||
PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)" | ||
curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" https://webhooks.gitter.im/e/7f95bf605c4d356372f4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
run: | ||
timeout: 5m | ||
linters: | ||
enable: | ||
- asciicheck | ||
- depguard | ||
- dogsled | ||
- durationcheck | ||
- errcheck | ||
- errorlint | ||
- exportloopref | ||
- gci | ||
- gofmt | ||
- goimports | ||
- gosec | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- nolintlint | ||
- revive | ||
- wastedassign | ||
issues: | ||
exclude-rules: | ||
- linters: | ||
- structcheck | ||
- unused | ||
text: "`data` is unused" | ||
- linters: | ||
- staticcheck | ||
text: "SA1019:" | ||
- linters: | ||
- revive | ||
text: "var-naming:" | ||
- linters: | ||
- revive | ||
text: "exported:" | ||
- path: _test\.go | ||
linters: | ||
- gosec # security is not make sense in tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
project_name: gin | ||
|
||
builds: | ||
- | ||
# If true, skip the build. | ||
# Useful for library projects. | ||
# Default is false | ||
skip: true | ||
|
||
changelog: | ||
# Set it to true if you wish to skip the changelog generation. | ||
# This may result in an empty release notes on GitHub/GitLab/Gitea. | ||
skip: false | ||
|
||
# Changelog generation implementation to use. | ||
# | ||
# Valid options are: | ||
# - `git`: uses `git log`; | ||
# - `github`: uses the compare GitHub API, appending the author login to the changelog. | ||
# - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog. | ||
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature. | ||
# | ||
# Defaults to `git`. | ||
use: git | ||
|
||
# Sorts the changelog by the commit's messages. | ||
# Could either be asc, desc or empty | ||
# Default is empty | ||
sort: asc | ||
|
||
# Group commits messages by given regex and title. | ||
# Order value defines the order of the groups. | ||
# Proving no regex means all commits will be grouped under the default group. | ||
# Groups are disabled when using github-native, as it already groups things by itself. | ||
# | ||
# Default is no groups. | ||
groups: | ||
- title: Features | ||
regexp: "^.*feat[(\\w)]*:+.*$" | ||
order: 0 | ||
- title: 'Bug fixes' | ||
regexp: "^.*fix[(\\w)]*:+.*$" | ||
order: 1 | ||
- title: 'Enhancements' | ||
regexp: "^.*chore[(\\w)]*:+.*$" | ||
order: 2 | ||
- title: Others | ||
order: 999 | ||
|
||
filters: | ||
# Commit messages matching the regexp listed here will be removed from | ||
# the changelog | ||
# Default is empty | ||
exclude: | ||
- '^docs' | ||
- 'CICD' | ||
- typo |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.