From 6c46ebca2ad6c8aca15ca4993ed9e4b489be130c Mon Sep 17 00:00:00 2001 From: ginohu Date: Thu, 25 Jan 2024 19:36:06 +0800 Subject: [PATCH] Update go.yml --- .github/workflows/go.yml | 51 +++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c69327f..d33ff98 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -11,15 +11,48 @@ on: jobs: - build: - runs-on: ubuntu-latest + test: + name: Test + strategy: + matrix: + os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] + go-version: [ "1.19", "1.20", "1.21" ] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 + - name: setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v3 with: - go-version: '1.20' - - - name: Test + go-version: ${{ matrix.go-version }} + - name: test run: go test -v ./... + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.21' + - name: lint + run: | + make lint + + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.21' + - name: measure coverage + run: make cover + - uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + verbose: true \ No newline at end of file