2023-07-13 11:44:05 +00:00
|
|
|
name: Build
|
|
|
|
run-name: Building and testing DC
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Build-and-ng-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
|
|
|
|
- name: Write .npmrc file
|
|
|
|
run: echo "$NPMRC" > client/.npmrc
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
NPMRC: ${{ secrets.NPMRC}}
|
|
|
|
|
|
|
|
- run: apt-get update
|
|
|
|
- run: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
|
|
- run: apt install -y ./google-chrome*.deb;
|
|
|
|
- run: export CHROME_BIN=/usr/bin/google-chrome
|
|
|
|
- run: npm run lint:check
|
|
|
|
# Install dependencies~
|
2023-07-14 10:27:33 +00:00
|
|
|
- run: npm ci
|
2023-07-13 11:44:05 +00:00
|
|
|
# Audit should fail and stop the CI if critical vulnerability found
|
|
|
|
- run: npm audit --audit-level=critical
|
|
|
|
- run: |
|
|
|
|
cd ./sas
|
|
|
|
npm audit --audit-level=critical
|
|
|
|
- run: |
|
|
|
|
cd ./client
|
|
|
|
npm audit --audit-level=critical
|
|
|
|
npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
|
|
|
|
npm run postinstall
|
|
|
|
npm run build
|