Compare commits

...

3 Commits

Author SHA1 Message Date
Mihajlo Medjedovic
ca281b70c9 chore(git): Merge branch 'development' into tsdoc
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 22s
2023-08-01 14:52:53 +02:00
0ae35214fb Merge pull request 'Removed ng build and ng test from PR action' (#17) from ci into development
Reviewed-on: #17
Reviewed-by: allan <allan@4gl.io>
2023-07-31 12:05:32 +00:00
Mihajlo Medjedovic
34ffac39cb ci: PR will only run lint check
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 23s
2023-07-31 13:13:00 +02:00
2 changed files with 55 additions and 21 deletions

View File

@ -1,5 +1,5 @@
name: Build
run-name: Building and testing DC
run-name: Running Lint Check
on: [pull_request]
jobs:
@ -18,21 +18,4 @@ jobs:
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~
- run: npm ci
# 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
- run: npm run lint:check

View File

@ -6,6 +6,53 @@ on:
- development
jobs:
Build-production-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: |
touch client/.npmrc
echo '${{ secrets.NPMRC}}' > client/.npmrc
- name: Install Chrome for Angular tests
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
- name: Write cypress credentials
run: echo "$CYPRESS_CREDS" > ./client/cypress.env.json
shell: bash
env:
CYPRESS_CREDS: ${{ secrets.CYPRESS_CREDS }}
- name: Install dependencies
run: npm ci
- name: Check audit
# Audit should fail and stop the CI if critical vulnerability found
run: |
npm audit --audit-level=critical
cd ./sas
npm audit --audit-level=critical
cd ./client
npm audit --audit-level=critical
- name: Angular Tests
run: |
npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
- name: Angular Production Build
run: |
npm run postinstall
npm run build
Build-and-test-development:
runs-on: ubuntu-latest
@ -34,7 +81,9 @@ jobs:
env:
CYPRESS_CREDS: ${{ secrets.CYPRESS_CREDS }}
- run: npm ci
- name: Install dependencies
run: npm ci
# Install pm2 and prepare SASJS server
- run: npm i -g pm2
- run: curl -L https://github.com/sasjs/server/releases/latest/download/linux.zip > linux.zip
@ -117,7 +166,9 @@ jobs:
env:
CYPRESS_CREDS: ${{ secrets.CYPRESS_CREDS }}
- run: npm ci
- name: Install dependencies
run: npm ci
# Install pm2 and prepare SASJS server
- run: npm i -g pm2
- run: curl -L https://github.com/sasjs/server/releases/latest/download/linux.zip > linux.zip