From 9e018081b8268df48fdbd4b214fedf05dca6095f Mon Sep 17 00:00:00 2001 From: rajutkarsh07 Date: Tue, 12 Nov 2024 13:15:21 +0530 Subject: [PATCH 1/4] fixed ci --- .github/workflows/frontend-ci.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 5cf9f243..b282248f 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -7,8 +7,8 @@ on: branches: [feature/webiu-2024] jobs: - build-and-deploy: - name: Build, Test, and Deploy Angular (webiu-ui) + build-webiu-ui: + name: Build and Test Angular (webiu-ui) runs-on: ubuntu-latest steps: @@ -20,6 +20,16 @@ jobs: with: node-version: '20' + - name: Checkout target branch + uses: actions/checkout@v4 + with: + ref: feature/webiu-2024 + + - name: Fetch pull request changes + run: | + git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge:pr + git checkout pr + - name: Install Angular CLI run: npm install -g @angular/cli @@ -31,17 +41,9 @@ jobs: - name: Build Angular App run: | cd webiu-ui - ng build --output-path=../docs --base-href="/Webiu/" + npm run build - name: Run Angular Tests - env: - CHROME_BIN: google-chrome - run: | - cd webiu-ui - ng test --watch=false --browsers=ChromeHeadless --no-sandbox - - - name: Deploy to GitHub Pages - if: github.ref == 'refs/heads/feature/webiu-2024' run: | cd webiu-ui - ngh --dir=../docs + npm test From 12e90922389c46f37f9fdf3c3643b7a40e200da8 Mon Sep 17 00:00:00 2001 From: rajutkarsh07 Date: Tue, 12 Nov 2024 13:21:42 +0530 Subject: [PATCH 2/4] refactoring changes --- .github/workflows/frontend-ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index b282248f..7a7b10b7 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -31,13 +31,20 @@ jobs: git checkout pr - name: Install Angular CLI - run: npm install -g @angular/cli + run: | + cd webiu-ui + npm install -g @angular/cli - name: Install dependencies run: | cd webiu-ui npm install + - name: Install Chrome + run: | + sudo apt-get update + sudo apt-get install -y google-chrome-stable + - name: Build Angular App run: | cd webiu-ui @@ -47,3 +54,4 @@ jobs: run: | cd webiu-ui npm test + npm test -- --browsers=ChromeHeadless --watch=false From f8924659dfa373ce8228e8755a4d72bcea2bb169 Mon Sep 17 00:00:00 2001 From: rajutkarsh07 Date: Tue, 12 Nov 2024 13:25:10 +0530 Subject: [PATCH 3/4] refactor --- .github/workflows/frontend-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 7a7b10b7..c50a4d2a 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -54,4 +54,4 @@ jobs: run: | cd webiu-ui npm test - npm test -- --browsers=ChromeHeadless --watch=false + npm test -- --browsers=ChromeHeadless --watch=false --no-sandbox From f54ddcaf7756d70732c4c0604ec2dfe5e304eddc Mon Sep 17 00:00:00 2001 From: rajutkarsh07 Date: Tue, 12 Nov 2024 13:30:06 +0530 Subject: [PATCH 4/4] fix --- .github/workflows/frontend-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index c50a4d2a..aab8893b 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -53,5 +53,4 @@ jobs: - name: Run Angular Tests run: | cd webiu-ui - npm test - npm test -- --browsers=ChromeHeadless --watch=false --no-sandbox + npm test -- --browsers=ChromeHeadless --watch=false