| 1 |
name: NATS Server Code Coverage |
| 2 |
on: |
| 3 |
workflow_dispatch: {} |
| 4 |
|
| 5 |
schedule: |
| 6 |
- cron: "40 4 * * *" |
| 7 |
|
| 8 |
permissions: |
| 9 |
contents: read |
| 10 |
|
| 11 |
jobs: |
| 12 |
nightly_coverage: |
| 13 |
runs-on: ubuntu-latest |
| 14 |
|
| 15 |
env: |
| 16 |
GOPATH: /home/runner/work/nats-server |
| 17 |
GO111MODULE: "on" |
| 18 |
|
| 19 |
steps: |
| 20 |
- name: Checkout code |
| 21 |
uses: actions/checkout@v6 |
| 22 |
with: |
| 23 |
path: src/github.com/nats-io/nats-server |
| 24 |
|
| 25 |
- name: Set up Go |
| 26 |
uses: actions/setup-go@v6 |
| 27 |
with: |
| 28 |
go-version: stable |
| 29 |
cache-dependency-path: src/github.com/nats-io/nats-server/go.sum |
| 30 |
|
| 31 |
- name: Run code coverage |
| 32 |
shell: bash --noprofile --norc -x -eo pipefail {0} |
| 33 |
run: | |
| 34 |
set -e |
| 35 |
cd src/github.com/nats-io/nats-server |
| 36 |
./scripts/cov.sh upload |
| 37 |
set +e |
| 38 |
|
| 39 |
- name: Convert coverage.out to coverage.lcov |
| 40 |
# Use commit hash here to avoid a re-tagging attack, as this is a third-party action |
| 41 |
# Commit e4612787670fc5b5f49026b8c29c5569921de1db = tag v1.2.0 |
| 42 |
uses: jandelgado/gcov2lcov-action@e4612787670fc5b5f49026b8c29c5569921de1db |
| 43 |
with: |
| 44 |
infile: acc.out |
| 45 |
working-directory: src/github.com/nats-io/nats-server |
| 46 |
|
| 47 |
- name: Coveralls |
| 48 |
# Use commit hash here to avoid a re-tagging attack, as this is a third-party action |
| 49 |
# Commit 5cbfd81b66ca5d10c19b062c04de0199c215fb6e = tag v2.3.7 |
| 50 |
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e |
| 51 |
with: |
| 52 |
github-token: ${{ secrets.github_token }} |
| 53 |
file: src/github.com/nats-io/nats-server/coverage.lcov |