diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7c129bb..c2a0b94 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -16,29 +16,21 @@ jobs: node: [16, 18] # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Check-out repository + - name: Checkout repository uses: actions/checkout@v2 + with: + fetch-depth: 2 - # Runs a single command using the runners shell - - name: Setup Node.js environment - uses: actions/setup-node@v4 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} - # Install project - - name: Install project + - name: Install dependencies run: npm install - - run: npm t - - name: Generate JaCoCo Badge - # if: ${{ github.ref == 'refs/heads/master' }} - uses: cicirello/jacoco-badge-generator@v2 - with: - jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv - badges-directory: build/reports/jacoco/test/html/badges - - name: Publish coverage report to GitHub Pages - # if: ${{ github.ref == 'refs/heads/master' }} - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: build/reports/jacoco/test/html + - name: Run tests + run: npm t + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 diff --git a/package.json b/package.json index a098573..0312798 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "node src/index.js", "dev": "nodemon src/index.js", "testWatch": "cross-env PORT=5001 NODE_OPTIONS='--experimental-vm-modules'; npx jest --watchAll --testTimeout=10000 --detectOpenHandles", - "test": "cross-env PORT=4001 NODE_OPTIONS='--experimental-vm-modules'; jest --coverage --forceExit" + "test": "cross-env PORT=4001 NODE_OPTIONS='--experimental-vm-modules'; jest --coverage --testTimeout=10000 --forceExit" }, "repository": { "type": "git",