1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 03:53:50 +08:00

add glangci-lint to ci

This commit is contained in:
Ink-33 2021-02-09 02:05:41 +08:00
parent 203b68b740
commit 1b3842fc98
No known key found for this signature in database
GPG Key ID: 5D8B1D036EFB0D2E

View File

@ -27,32 +27,36 @@ jobs:
- goos: windows - goos: windows
goarch: arm64 goarch: arm64
fail-fast: true fail-fast: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Go environment
- name: Setup Go environment uses: actions/setup-go@v2.1.3
uses: actions/setup-go@v2.1.3 with:
with: go-version: 1.15
go-version: 1.15 - name: Build binary file
env:
- name: Build binary file GOOS: ${{ matrix.goos }}
env: GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }} IS_PR: ${{ !!github.head_ref }}
GOARCH: ${{ matrix.goarch }} run: |
IS_PR: ${{ !!github.head_ref }} if [ $GOOS = "windows" ]; then export BINARY_SUFFIX="$BINARY_SUFFIX.exe"; fi
run: | if $IS_PR ; then echo $PR_PROMPT; fi
if [ $GOOS = "windows" ]; then export BINARY_SUFFIX="$BINARY_SUFFIX.exe"; fi export BINARY_NAME="$BINARY_PREFIX$GOOS_$GOARCH$BINARY_SUFFIX"
if $IS_PR ; then echo $PR_PROMPT; fi export CGO_ENABLED=0
export BINARY_NAME="$BINARY_PREFIX$GOOS_$GOARCH$BINARY_SUFFIX" go build -o "output/$BINARY_NAME" -ldflags "$LD_FLAGS" .
export CGO_ENABLED=0 - name: Upload artifact
go build -o "output/$BINARY_NAME" -ldflags "$LD_FLAGS" . uses: actions/upload-artifact@v2
if: ${{ !github.head_ref }}
- name: Upload artifact with:
uses: actions/upload-artifact@v2 name: ${{ matrix.goos }}_${{ matrix.goarch }}
if: ${{ !github.head_ref }} path: output/
with:
name: ${{ matrix.goos }}_${{ matrix.goarch }}
path: output/
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29