-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (52 loc) · 1.54 KB
/
utest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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