From 950143e17d0cfeaa7cccc14045897190d786a0e4 Mon Sep 17 00:00:00 2001 From: Natercio Moniz Date: Wed, 26 Nov 2025 10:19:43 +0000 Subject: [PATCH 1/2] update coveralls badge when main is updated --- .gitea/workflows/badges.yml | 32 ++++++++++++++++++++++++++++++++ .gitea/workflows/quality.yml | 10 ---------- 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 .gitea/workflows/badges.yml diff --git a/.gitea/workflows/badges.yml b/.gitea/workflows/badges.yml new file mode 100644 index 0000000..c4ae4b0 --- /dev/null +++ b/.gitea/workflows/badges.yml @@ -0,0 +1,32 @@ +name: Badges + +on: + push: + branches: + - main + +jobs: + coveralls: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.25 + + - name: Run Unit tests + run: | + go test -covermode atomic -coverprofile=coverage.out ./... + grep -v -E "(main|_gen).go" coverage.out > coverage.filtered.out + mv coverage.filtered.out coverage.out + + - name: Install goveralls + run: go install github.com/mattn/goveralls@v0.0.12 + + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}} + run: goveralls -coverprofile=coverage.out -service=github diff --git a/.gitea/workflows/quality.yml b/.gitea/workflows/quality.yml index 71ce4e2..8c40736 100644 --- a/.gitea/workflows/quality.yml +++ b/.gitea/workflows/quality.yml @@ -40,13 +40,3 @@ jobs: - name: Run Unit tests run: | go test -race -covermode atomic -coverprofile=coverage.out ./... - grep -v "_gen.go" coverage.out > coverage.filtered.out - mv coverage.filtered.out coverage.out - - - name: Install goveralls - run: go install github.com/mattn/goveralls@v0.0.12 - - - name: Send coverage - env: - COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}} - run: goveralls -coverprofile=coverage.out -service=github From d415fcd7529ec69e3fc4523b013c4deeeb7e49b8 Mon Sep 17 00:00:00 2001 From: Natercio Moniz Date: Wed, 26 Nov 2025 10:32:27 +0000 Subject: [PATCH 2/2] separate coveralls and refine workflow triggers --- .gitea/workflows/badges.yml | 2 +- .gitea/workflows/gen_code.yml | 4 ++-- .gitea/workflows/quality.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/badges.yml b/.gitea/workflows/badges.yml index c4ae4b0..da91fe6 100644 --- a/.gitea/workflows/badges.yml +++ b/.gitea/workflows/badges.yml @@ -17,7 +17,7 @@ jobs: with: go-version: 1.25 - - name: Run Unit tests + - name: Run Unit tests with coverage run: | go test -covermode atomic -coverprofile=coverage.out ./... grep -v -E "(main|_gen).go" coverage.out > coverage.filtered.out diff --git a/.gitea/workflows/gen_code.yml b/.gitea/workflows/gen_code.yml index ac0e573..0d71388 100644 --- a/.gitea/workflows/gen_code.yml +++ b/.gitea/workflows/gen_code.yml @@ -1,8 +1,8 @@ name: Generate check on: - push: pull_request: + types: [opened, reopened, synchronize] jobs: check-changes: @@ -24,7 +24,7 @@ jobs: echo "has_gen_changes=false" >> $GITHUB_OUTPUT fi - check-generate: + verify-generate: runs-on: ubuntu-latest needs: check-changes if: needs.check-changes.outputs.has_gen_changes == 'true' diff --git a/.gitea/workflows/quality.yml b/.gitea/workflows/quality.yml index 8c40736..8282af0 100644 --- a/.gitea/workflows/quality.yml +++ b/.gitea/workflows/quality.yml @@ -24,7 +24,7 @@ jobs: echo "has_go_changes=false" >> $GITHUB_OUTPUT fi - tests: + run-tests: runs-on: ubuntu-latest needs: check-changes if: needs.check-changes.outputs.has_go_changes == 'true'