barecheck / code-coverage-action

GitHub Action that generates code coverage reports
https://barecheck.com
MIT License
57 stars 14 forks source link

Still receiving Node.js 16 deprecation warnings. #262

Closed vladsha-dev closed 7 months ago

vladsha-dev commented 7 months ago

Hi @vitaliimelnychuk I just attempted to rerun the job that utilizes barecheck/code-coverage-action@v1 after the Node.js upgrade you performed, and I am still encountering the Node.js 16 deprecation warning.

Warning

check-fe-code-cov
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: barecheck/code-coverage-action@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Job

  check-fe-code-cov:
    needs:
      - get-base-branch-fe-cov
      - run-fe-code-quality
    runs-on: ubuntu-latest
    steps:
      - name: Download Jest code cov reports
        uses: actions/download-artifact@v4
        with:
          pattern: '*-jest-code-cov'
      - name: Verify Jest code cov
        uses: barecheck/code-coverage-action@v1
        with:
          barecheck-github-app-token: ${{ example-example }}
          lcov-file: './feature-branch-fe-jest-code-cov/lcov.info'
          base-lcov-file: './base-branch-fe-jest-code-cov/lcov.info'
          minimum-ratio: 0
          send-summary-comment: true
          show-annotations: 'warning'
vitaliimelnychuk commented 7 months ago

@vladsha-dev if you look here:

name: Code Coverage

on: [pull_request]

jobs:
  base_branch_cov:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.base_ref }}
      - name: Use Node.js v20.9.0
        uses: actions/setup-node@v3
        with:
          node-version: v20.9.0

      - name: Install dependencies
        run: yarn

      - name: Run test coverage
        run: yarn coverage

      - name: Upload code coverage for ref branch
        uses: actions/upload-artifact@v3
        with:
          name: ref-lcov.info
          path: ./coverage/lcov.info

  checks:
    runs-on: ubuntu-latest
    needs: base_branch_cov
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js v20.9.0
        uses: actions/setup-node@v3
        with:
          node-version: v20.9.0

      - name: Download code coverage report from base branch
        uses: actions/download-artifact@v3
        with:
          name: ref-lcov.info

      - name: Install dependencies
        run: yarn

      - name: Run test coverage
        run: yarn coverage

      #  Compares two code coverage files and generates report as a comment
      - name: Generate Code Coverage report
        id: code-coverage
        uses: barecheck/code-coverage-action@v1
        with:
          barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }}
          lcov-file: "./coverage/lcov.info"
          base-lcov-file: "./lcov.info"
          minimum-ratio: 0 # Fails Github action once code coverage is decreasing
          send-summary-comment: true
          show-annotations: "warning" # Possible options warning|error

You have to set node version on your side, this is not coming for the action itself I believe

vitaliimelnychuk commented 7 months ago

@vladsha-dev Added also 'force' using 20 version from my side. Let me know if you still have issues

vladsha-dev commented 7 months ago

Thanks, @vitaliimelnychuk! After rerunning the job one more time, no warnings. :) I think it's because you forced the use of version 20.