fix:优化example #149
Workflow file for this run
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
name: Go | |
on: | |
push: | |
branches: [ "main","feature/**" ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: write | |
# Always force the use of Go modules | |
env: | |
GO111MODULE: on | |
jobs: | |
golangci: | |
strategy: | |
matrix: | |
go-version: [1.15.x,1.16.x,1.17.x,1.18.x] | |
name: golangci-lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v3 | |
- uses: actions/checkout@v3 | |
- name: golangci-lint | |
uses: golangci/[email protected] | |
with: | |
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | |
version: latest | |
Reviveci: | |
strategy: | |
matrix: | |
go-version: [1.15.x,1.16.x,1.17.x,1.18.x] | |
name: Run Revive Action | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v3 | |
- uses: actions/checkout@v3 | |
- name: Run Revive Action | |
uses: morphy2k/revive-action@v2 | |
with: | |
# Path to your Revive config within the repo (optional) | |
config: revive.toml | |
# staticcheckci: | |
# name: "staticcheck" | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v1 | |
# with: | |
# fetch-depth: 1 | |
# - run: "go test ./..." | |
# - run: "go vet ./..." | |
# - uses: dominikh/[email protected] | |
# with: | |
# version: "2022.1" | |
# tests: | |
# runs-on: ubuntu-latest | |
# env: | |
# GO111MODULE: on | |
# steps: | |
# - name: Checkout Source | |
# uses: actions/checkout@v2 | |
# - name: Run go-mnd | |
# uses: tommy-muehle/go-mnd@master | |
# with: | |
# args: ./... | |
build: | |
runs-on: ubuntu-latest | |
# strategy set | |
strategy: | |
matrix: | |
go: ["1.15", "1.16", "1.17", "1.18"] | |
steps: | |
# Checkout latest code | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
# Setup the environment. | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
# Execute vert check | |
- name: vert check | |
run: bash ./ci/vet.sh -install && bash ./ci/vet.sh | |
# Run tests | |
- name: run tests | |
run: | | |
cd ./test | |
go test -timeout=50m |