From 6f5e02dbd63eb62d42dec382f2d9f9758112bd3a Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 9 Sep 2024 21:49:03 +0200 Subject: [PATCH] ci: refactor the way the CI is launched Code Climate should now be able to upload on merge It's not a problem if golangci-lint is launched after a release --- .github/workflows/ci.yml | 30 +------------------ .../workflows/{coverage.yml => golang.yml} | 13 ++++++-- 2 files changed, 12 insertions(+), 31 deletions(-) rename .github/workflows/{coverage.yml => golang.yml} (59%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b1bb1e..66fb063 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ --- -name: CI +name: Format & Lint on: pull_request: jobs: @@ -23,31 +23,3 @@ jobs: - name: editorconfig-checker-action uses: editorconfig-checker/action-editorconfig-checker@v2 - - go-lint: - runs-on: ubuntu-latest - steps: - - name: checkout-action - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v5 - - - name: Run tests - run: go test -coverprofile=coverage.txt - - - name: Upload results to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Code Climate Coverage Action - uses: paambaati/codeclimate-action@v9 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_REPORTER_ID }} - with: - coverageLocations: coverage.txt:gocov - prefix: github.com/ccoveille/go-safecast - - - name: Launch golangci-lint - uses: golangci/golangci-lint-action@v6.1.0 diff --git a/.github/workflows/coverage.yml b/.github/workflows/golang.yml similarity index 59% rename from .github/workflows/coverage.yml rename to .github/workflows/golang.yml index f30b358..68b947f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/golang.yml @@ -1,11 +1,12 @@ --- -name: Coverage +name: Test & Coverage on: + pull_request: push: branches: - main jobs: - go-lint: + go-test-coverage: runs-on: ubuntu-latest steps: - name: checkout-action @@ -22,5 +23,13 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Code Climate Coverage Action + uses: paambaati/codeclimate-action@v9 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_REPORTER_ID }} + with: + coverageLocations: coverage.txt:gocov + prefix: github.com/ccoveille/go-safecast + - name: Launch golangci-lint uses: golangci/golangci-lint-action@v6.1.0