From 71a1cd107f631e2c7712b7a8351222c0797fb822 Mon Sep 17 00:00:00 2001 From: dillonstreator Date: Sun, 17 Dec 2023 12:00:35 -0600 Subject: [PATCH] codecov --- .github/workflows/coverage.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..05d4da9 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,32 @@ +name: Running Code Coverage + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: yarn install + + - name: Run the tests + run: yarn test:ci + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 8f74b84..89b6705 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "prepublish": "yarn build", "clean": "rimraf dist", "nuke": "rimraf node_modules dist", - "test": "vitest" + "test": "vitest", + "test:ci": "vitest --run --coverage" }, "dependencies": { "pg": "^8.11.3",