Skip to content

ci: add test coverage reporting with Codecov (#5) #34

ci: add test coverage reporting with Codecov (#5)

ci: add test coverage reporting with Codecov (#5) #34

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
packages: read
jobs:
test:
name: CI
runs-on: ubuntu-latest
services:
nats:
image: nats@sha256:c9abdce88a85ed5fcc8e9fc6b284d2601f5d1c1d0d58ddd67cfdc411768bfd7f # latest
ports:
- "4222:4222"
steps:
- name: Wait for NATS
run: timeout 30 bash -c 'until nc -z localhost 4222; do sleep 0.5; done'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
registry-url: "https://npm.pkg.github.com"
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run build
- run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: ./coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}