[To Main] Task - DESENG-682: Upgrade to node 20 #4007
Workflow file for this run
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
name: MET WEB CI | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "met-web/**" | |
push: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./met-web | |
jobs: | |
setup-job: | |
runs-on: ubuntu-20.04 | |
if: github.repository == 'bcgov/met-public' | |
steps: | |
- uses: actions/checkout@v3 | |
- run: "true" | |
linting: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install --legacy-peer-deps | |
env: | |
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} | |
- name: Lint | |
id: lint | |
run: | | |
npm run lint | |
testing: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install --legacy-peer-deps | |
env: | |
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} | |
- name: Test with jest | |
id: test | |
run: | | |
npm test -- --coverage | |
# Set codecov branch name with prefix if pull request | |
- name: Sets Codecov branch name | |
run: | | |
echo "CODECOV_BRANCH=PR_${{github.head_ref}}" >> $GITHUB_ENV | |
if: github.event_name == 'pull_request' | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: metweb | |
name: codecov-met-web | |
fail_ci_if_error: true | |
verbose: true | |
override_branch: ${{env.CODECOV_BRANCH}} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build-check: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install --legacy-peer-deps | |
env: | |
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} | |
- name: build to check strictness | |
id: build | |
run: | | |
npm run build |