diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cda8a0c..44d856b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,12 @@ jobs: with: path: node_modules key: ${{ needs.setup.outputs.cache-key }} - - run: npm test + - run: npm run test:ci + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: PermanentOrg/sftp-service + fail_ci_if_error: true build: needs: [setup] diff --git a/jest.config.js b/jest.config.js index 01cb011..dcf2ec2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,4 +3,7 @@ module.exports = { silent: true, passWithNoTests: true, preset: "ts-jest", + collectCoverageFrom: ["src/**/*.ts", "!src/**/*.test.ts"], + coverageDirectory: "coverage", + coverageReporters: ["text", "lcov"], }; diff --git a/package.json b/package.json index f961945..4dceac8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "format:eslint": "eslint ./src --fix || true", "start": "npm run build && node build/index.js", "dev": "nodemon --delay 500ms --exec ts-node src/index.ts", - "test": "jest" + "test": "jest", + "test:ci": "jest --coverage" }, "author": { "name": "Permanent.org",