diff options
author | Aoang <aoang@x2oe.com> | 2022-08-14 17:31:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-14 11:31:57 +0200 |
commit | ea6052464e7221956dedf9b9a523f8f9892c3d3b (patch) | |
tree | 089ef1b083c7d9edc7d54bc2485b1a564a2cc368 /.github | |
parent | Improve Client timeout (#1346) (diff) | |
download | fasthttp-ea6052464e7221956dedf9b9a523f8f9892c3d3b.tar.gz fasthttp-ea6052464e7221956dedf9b9a523f8f9892c3d3b.tar.bz2 fasthttp-ea6052464e7221956dedf9b9a523f8f9892c3d3b.zip |
* Update Go Version to Go1.19.x And add cache
* Fix CI Line endings
* Update test CI Go Version to Go1.19.x And add cache
* Update Gosec Security Scanner CI to securego/gosec@v2.12.0
* Format comment
Go 1.19 adds support for links, lists, and clearer headings in doc comments. As part of this change, gofmt now reformats doc comments to make their rendered meaning clearer. See “Go Doc Comments” for syntax details and descriptions of common mistakes now highlighted by gofmt. As another part of this change, the new package go/doc/comment provides parsing and reformatting of doc comments as well as support for rendering them to HTML, Markdown, and text.
ref: https://tip.golang.org/doc/go1.19
ref: https://tip.golang.org/doc/comment
* Fix doc structure
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/lint.yml | 40 | ||||
-rw-r--r-- | .github/workflows/security.yml | 16 | ||||
-rw-r--r-- | .github/workflows/test.yml | 19 |
3 files changed, 55 insertions, 20 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6c2c7b0..9e08c44 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,14 +9,40 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x + + - name: Get Go cache paths + id: go-env + run: | + echo "::set-output name=cache::$(go env GOCACHE)" + echo "::set-output name=modcache::$(go env GOMODCACHE)" + - name: Set up Go cache + uses: actions/cache@v3 + with: + key: golangci-lint-${{ runner.os }}-go-${{ hashFiles('go.mod') }} + restore-keys: golangci-lint-${{ runner.os }}-go- + path: | + ${{ steps.go-env.outputs.cache }} + ${{ steps.go-env.outputs.modcache }} + + - name: Install golangci-lint + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0 + + - name: Get golangci-lint cache path + id: golangci-lint-cache-status + run: | + echo "::set-output name=dir::$(golangci-lint cache status | head -1 | sed 's/^Dir: //')" + + - name: Set up golangci-lint cache + uses: actions/cache@v3 + with: + key: golangci-lint-${{ runner.os }}-golangci-lint-${{ hashFiles('go.mod') }} + restore-keys: golangci-lint-${{ runner.os }}-golangci-lint- + path: ${{ steps.golangci-lint-cache-status.outputs.dir }} + - run: go version - run: diff -u <(echo -n) <(gofmt -d .) - name: Run golangci-lint - run: | # https://github.com/golangci/golangci-lint/pull/2438 - export PATH=$PATH:$(go env GOPATH)/bin - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2 - golangci-lint run - + run: golangci-lint run diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 07c61ed..cad7643 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -8,20 +8,14 @@ jobs: test: strategy: matrix: - go-version: [1.18.x] + go-version: [1.19.x] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} env: GO111MODULE: on steps: - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - name: Run Gosec Security Scanner - run: | # https://github.com/securego/gosec/issues/469#issuecomment-1070608395 - export PATH=$PATH:$(go env GOPATH)/bin - go install github.com/securego/gosec/v2/cmd/gosec@latest - gosec -exclude=G104,G304,G402 ./... + uses: securego/gosec@v2.12.0 + with: + args: '-exclude=G104,G304,G402 ./...' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 429c155..73af78b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,14 +8,29 @@ jobs: test: strategy: matrix: - go-version: [1.15.x, 1.16.x, 1.17.x, 1.18.x] + go-version: [1.15.x, 1.16.x, 1.17.x, 1.18.x, 1.19.x] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} + + - name: Get Go cache paths + id: go-env + run: | + echo "::set-output name=cache::$(go env GOCACHE)" + echo "::set-output name=modcache::$(go env GOMODCACHE)" + - name: Set up Go cache + uses: actions/cache@v3 + with: + key: golangci-lint-${{ runner.os }}-go-${{ hashFiles('go.mod') }} + restore-keys: golangci-lint-${{ runner.os }}-go- + path: | + ${{ steps.go-env.outputs.cache }} + ${{ steps.go-env.outputs.modcache }} + - run: go version - run: go test ./... - run: go test -race ./... |