From f0b158cfb4b07605cf4bd073529e7089d16d871a Mon Sep 17 00:00:00 2001 From: tab Date: Fri, 1 Nov 2024 10:41:48 +0200 Subject: [PATCH] ci(workflow): Update GitHub Actions workflow Reorganized the workflow to separate linter and test jobs, updated Go versions, and added matrix for testing different Go versions. --- .github/workflows/checks.yaml | 38 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index e0397c4..0ee2c45 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -6,29 +6,43 @@ concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true jobs: - coverage: - name: Codecov + linter: + name: Golang CI runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.23.1' - - name: Run coverage - run: go test ./... -race -coverprofile=coverage.out -covermode=atomic - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + - name: Run linter + uses: golangci/golangci-lint-action@v6 with: - token: ${{ secrets.CODECOV_TOKEN }} - linter: - name: Golang CI + version: v1.60 + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go-version: [1.22, 1.23] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - name: Run tests + run: go test ./... + coverage: + name: Codecov runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.23.1' - - name: Run linter - uses: golangci/golangci-lint-action@v6 + - name: Run coverage + run: go test ./... -race -coverprofile=coverage.out -covermode=atomic + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 with: - version: v1.60 + token: ${{ secrets.CODECOV_TOKEN }}