Skip to content

Commit

Permalink
Add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wendy512 committed Oct 12, 2024
1 parent d94b453 commit 8d7af42
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/go-vet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Go Vet

on:
push:
branches:
- master
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
static-analysis:
# 定义矩阵的值,指定不同的平台
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Dependencies
run: go mod download

- name: Run Go Vet
run: go vet ./...

0 comments on commit 8d7af42

Please sign in to comment.