Feat/dev ops 281 284 #21
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: Unit-test | |
on: | |
pull_request: | |
branches: | |
- dev | |
workflow_call: | |
inputs: | |
branch: | |
description: 'The current branch' | |
default: dev | |
type: string | |
required: false | |
env: | |
BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'dev' }} | |
jobs: | |
utest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
- name: Remove .npmrc file if exists | |
run: | | |
if [ -f .npmrc ]; then | |
rm .npmrc | |
fi | |
- uses: actions/setup-node@v4 | |
with: | |
registry-url: 'https://packages.nuxeo.com/repository/npm-public/' | |
node-version: 20 | |
scope: '@nuxeo' | |
- name: Configure Additional Registries | |
run: | | |
npm config set @hylandsoftware:registry https://npm.pkg.github.com --global | |
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_TOKEN }} --global | |
npm config set registry https://registry.npmjs.org/ --global | |
- name: Install @angular/cli | |
run: npm install -g @angular/cli | |
- name: Install Dependencies | |
run: npm install | |
- name: Install Chrome and Xvfb | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y google-chrome-stable xvfb | |
- name: Start Xvfb | |
run: | | |
sudo Xvfb :99 -ac -screen 0 1280x1024x16 > /dev/null 2>&1 & | |
- name: Set DISPLAY variable | |
run: | | |
export DISPLAY=:99 | |
- name: Unit tests | |
run: npm run test |