mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-06-19 22:15:04 +08:00
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Lint
|
|
|
|
on: [push,workflow_dispatch]
|
|
|
|
jobs:
|
|
golangci:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Go environment
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: 1.16
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: latest
|
|
|
|
- name: Cache downloaded module
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
- name: Tests
|
|
run: |
|
|
go test $(go list ./...)
|
|
|
|
- name: Commit back
|
|
if: github.repository_owner == 'Mrs4s'
|
|
continue-on-error: true
|
|
run: |
|
|
git config --local user.name 'github-actions[bot]'
|
|
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
git add --all
|
|
git commit -m "ci(chore): Fix stylings"
|
|
git push
|