From 8b82defe05a534e4fc39cf20f9f43eda1606785a Mon Sep 17 00:00:00 2001 From: MichaelEakins Date: Thu, 15 Jan 2026 13:16:45 -0500 Subject: [PATCH] fix: add test workflow with coverage reporting - Add test.yml workflow for CI testing - Run tests on Node 18.x, 20.x, 22.x - Generate and upload coverage to Codecov - Add CODECOV_TOKEN for v4 API - Only upload from Node 20.x to avoid duplicates --- .github/workflows/test.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c5a9d9e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests with coverage + run: npm run test:coverage + + - name: Upload coverage to Codecov + if: matrix.node-version == '20.x' + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: unittests + fail_ci_if_error: false