From 64ac8c1cec02d0c636346d86117581d4c75bfd41 Mon Sep 17 00:00:00 2001 From: yiling Date: Tue, 19 Nov 2024 12:09:49 +0800 Subject: [PATCH] add lint/test ci --- .github/workflows/test.yaml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..adce73e7 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,42 @@ +name: Go + +on: + push: + branches: ['*', '*/*'] + tags: ['v*'] + pull_request: + branches: ['*'] + +permissions: + contents: read + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.52.2 + test: + name: test + strategy: + matrix: + go: ["1.21.x"] + runs-on: ubuntu-latest + steps: + - name: Setup Go + with: + go-version: ${{ matrix.go }} + uses: actions/setup-go@v2 + + - uses: actions/checkout@v2 + + - name: Test + run: go test ./...