NXP-32573: added unit tests, refactored code, fixed warning box focus issue & added .npmrc #6
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: Unit Test | |
on: | |
pull_request: | |
branches: | |
- dev | |
workflow_call: | |
inputs: | |
branch: | |
description: 'The current branch' | |
default: dev | |
type: string | |
required: false | |
secrets: | |
NPM_PACKAGES_TOKEN: | |
description: 'NPM_PACKAGES_TOKEN' | |
required: true | |
SAUCE_ACCESS_KEY: | |
description: 'SAUCE_ACCESS_KEY' | |
required: true | |
env: | |
BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'dev' }} | |
jobs: | |
unit-test: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://packages.nuxeo.com/repository/npm-public/' | |
scope: '@nuxeo' | |
node-version: 18 | |
- name: Install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm install | |
- name: Unit tests | |
env: | |
SAUCE_USERNAME: nuxeo-web-ui | |
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | |
run: npm run test |