Skip to content

Commit

Permalink
ci: refactor the way the CI is launched
Browse files Browse the repository at this point in the history
Code Climate should now be able to upload on merge

It's not a problem if golangci-lint is launched after a release
  • Loading branch information
ccoVeille committed Sep 9, 2024
1 parent 47910f0 commit 6f5e02d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 31 deletions.
30 changes: 1 addition & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: CI
name: Format & Lint
on:
pull_request:
jobs:
Expand All @@ -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/[email protected]

- 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/[email protected]
13 changes: 11 additions & 2 deletions .github/workflows/coverage.yml → .github/workflows/golang.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/[email protected]

0 comments on commit 6f5e02d

Please sign in to comment.