From 8d7af4246847214762b62615f2ac20a85ba65a75 Mon Sep 17 00:00:00 2001 From: wendy512 Date: Sat, 12 Oct 2024 14:04:39 +0800 Subject: [PATCH] Add github workflow --- .github/workflows/go-vet.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/go-vet.yml diff --git a/.github/workflows/go-vet.yml b/.github/workflows/go-vet.yml new file mode 100644 index 0000000..78dfe41 --- /dev/null +++ b/.github/workflows/go-vet.yml @@ -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 ./... \ No newline at end of file