Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code coverage ci #470

Merged
merged 5 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Code Coverage

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- 'main'

env:
GO_VER: '1.23.*'

jobs:
unit_tests:
name: "Unit tests"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
cache: false

- name: Test
run: go test $(go list ./... | grep -v "github.com/synadia-io/nex/test" | grep -v gen | grep -v pb) -coverprofile=coverage-${{ github.event.number }}.txt

- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: coverage-${{ github.event.number }}.txt

code_coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: unit_tests
permissions:
contents: read
actions: read
pull-requests: write
steps:
- uses: fgrosse/[email protected]
with:
coverage-artifact-name: "code-coverage"
coverage-file-name: "coverage-${{ github.event.number }}.txt"
4 changes: 2 additions & 2 deletions .github/workflows/ltb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "main" ]

env:
GO_VER: '1.23.0'
GO_VER: '1.23.*'


jobs:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
-
name: Run test suite | node
run: |
go test -v ./...
go test -v github.com/synadia-io/nex/test
-
name: Run test suite | CLI
working-directory: ./cmd/nex
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/schema_generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: main

env:
GO_VER: '1.23.*'

jobs:
verify-schema-generation:
runs-on: ubuntu-latest
Expand All @@ -17,7 +20,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23' # Specify your Go version
go-version: ${{ env.GO_VER }}
cache: false

- name: Install Taskfile
run: |
Expand Down
Loading