(MAJOR) Update node from v16 to v20 (#106) #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Summary: | |
# Run Unit and coverage tests, then upload it to Code Climate dashboard | |
# | |
# See https://github.com/actions/checkout https://github.com/actions/checkout/releases/tag/v3 | |
# See https://github.com/paambaati/codeclimate-action https://github.com/paambaati/codeclimate-action/tree/v3.2.0 | |
name: Update Code Climate test coverage | |
on: | |
push: | |
branches: | |
- main # Change this branch name by your CodeClimate "main" branch use | |
jobs: | |
# Configures the deployment environment, install dependencies (like node, npm, etc.) that are requirements for the upcoming jobs | |
# Ex: Necessary to run `yarn test:coverage` | |
setup-environment: | |
name: Setup deployment environment (Ubuntu 22.04 - Node 20.x) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Installing node.js | |
uses: actions/setup-node@v3 # Used to install node environment - XXX https://github.com/actions/setup-node | |
with: | |
node-version: 20 # Use the same node.js version as the one Vercel's uses (currently node20.x) | |
run-tests-coverage: | |
name: Run tests coverage and send report to Code Climate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Installing dependencies | |
run: yarn install | |
- uses: paambaati/codeclimate-action@v3.2.0 | |
env: | |
# XXX Necessary for running tests properly (required). Do not generate the token from a Vercel account with actual production usage. (use a dummy account) | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # XXX Define this secret in "Github repo > Settings > Secrets", you can get it from Vercel at https://vercel.com/account/tokens | |
VERCEL_DOMAIN: ${{ secrets.VERCEL_DOMAIN }} # XXX Define this secret in "Github repo > Settings > Secrets", it should use a domain the VERCEL_TOKEN you provided has access to | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} # XXX Define this secret in "Github repo > Settings > Secrets", you can get it from Code Climate in "Repo settings > Test coverage". | |
with: | |
coverageCommand: yarn test:coverage |