From 14cd7ff09ef4d2346e4b272057d91533d71f3b88 Mon Sep 17 00:00:00 2001 From: Hugo C <911307+hugocaillard@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:27:55 +0200 Subject: [PATCH] ci: publish coverage to codecov (#10) --- .github/workflows/test-contrat.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-contrat.yml b/.github/workflows/test-contrat.yml index a2a4b79..bbfd7dc 100644 --- a/.github/workflows/test-contrat.yml +++ b/.github/workflows/test-contrat.yml @@ -10,7 +10,7 @@ on: branches: [ "main" ] jobs: - build: + test: runs-on: ubuntu-latest @@ -20,11 +20,18 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm test + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run test:reports + + - name: Upload coverage data to codecov + if: ${{ matrix.node-version == '20.x' }} + uses: codecov/codecov-action@v4 + with: + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }}