Skip to content

Commit c667668

Browse files
authored
fix(cd): resolving errors in cd matrix runs (#3868)
1 parent a7dd135 commit c667668

File tree

7 files changed

+97
-134
lines changed

7 files changed

+97
-134
lines changed

.github/workflows/build-app.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: App Main CI
4+
5+
permissions:
6+
contents: read
7+
8+
# Controls when the action will run. Triggers the workflow on push or pull request
9+
# events but only for the master branch
10+
on:
11+
push:
12+
branches: [ master, vnext ]
13+
paths:
14+
- '**'
15+
- '!projects/**'
16+
pull_request:
17+
branches: [ master, vnext ]
18+
paths:
19+
- '**'
20+
- '!projects/**'
21+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
22+
jobs:
23+
# This workflow contains a single job called "build"
24+
build:
25+
# The type of runner that the job will run on
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
matrix:
30+
node-version: [20.x, 22.x]
31+
32+
# Steps represent a sequence of tasks that will be executed as part of the job
33+
steps:
34+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
35+
- uses: actions/checkout@v3
36+
37+
- name: Use Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
cache: 'npm'
42+
43+
- name: Npm add registry
44+
run: npm config set @infragistics:registry https://${{secrets.IG_SCOPE}}
45+
46+
- name: Npm config auth
47+
run: npm config set ${{secrets.IG_SCOPE}}:_auth=${{secrets.IG_TOKEN}}
48+
49+
- name: Install dependencies
50+
run: npm install
51+
52+
- name: Run lint
53+
run: npm run lint
54+
55+
- name: 'Generate live editing and build samples'
56+
run: npm run build
57+
env:
58+
NODE_OPTIONS: "--max_old_space_size=4096"

.github/workflows/cd-matrix.yml

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- master
99
- vnext
1010
workflow_dispatch:
11-
workflow_dispatch:
1211
inputs:
1312
branch:
1413
description: 'Input a branch name (e.g., vnext)'
@@ -27,23 +26,23 @@ jobs:
2726
- name: app
2827
custom_command: run generate-live-editing
2928
submodule_dir: angular-demos
30-
base_href: /angular-demos/
29+
base_href: angular-demos
3130
target_folder: dist/app
3231
npm_build_command: run build-ci
3332
repositoryfy: true
3433
repositoryfy_command: repositoryfyAngularDemos
3534
- name: app-crm
3635
custom_command: run generate-live-editing:app-crm
3736
submodule_dir: angular-demos-crm
38-
base_href: /angular-demos-grid-crm/
37+
base_href: angular-demos-grid-crm
3938
target_folder: dist/app-crm
4039
npm_build_command: run build-ci:app-crm --loglevel verbose
4140
repositoryfy: false
4241
repositoryfy_command: ''
4342
- name: app-lob
4443
custom_command: run generate-live-editing:app-lob
4544
submodule_dir: angular-demos-lob
46-
base_href: /angular-demos-lob/
45+
base_href: angular-demos-lob
4746
target_folder: dist/app-lob
4847
npm_build_command: run build-ci:app-lob
4948
repositoryfy: true
@@ -54,6 +53,7 @@ jobs:
5453
uses: actions/checkout@v4
5554
with:
5655
fetch-depth: 0
56+
ref: ${{ env.BRANCH_REF }}
5757
token: ${{ secrets.GITHUB_TOKEN }}
5858

5959
- name: Setup Node.js
@@ -76,36 +76,41 @@ jobs:
7676
}
7777
7878
- name: Create .npmrc file
79-
run: touch .npmrc
79+
run: |
80+
if [ -f ".npmrc" ]; then
81+
rm .npmrc
82+
fi
83+
touch .npmrc
84+
8085
8186
- name: Configure npm registry
8287
run: |
8388
echo "@infragistics:registry=https://packages.infragistics.com/npm/js-licensed/" >> .npmrc
84-
echo "//packages.infragistics.com/npm/js-licensed/:_authToken=${{ secrets.INFRAGISTICS_NPM_TOKEN }}" >> .npmrc
89+
echo "//packages.infragistics.com/npm/js-licensed/:username=${{ secrets.INFRAGISTICS_NPM_USER }}" >> .npmrc
90+
echo "//packages.infragistics.com/npm/js-licensed/:_auth=${{ secrets.INFRAGISTICS_NPM_TOKEN }}" >> .npmrc
91+
# echo "//packages.infragistics.com/npm/js-licensed/:_authToken=${{ secrets.INFRAGISTICS_NPM_TOKEN }}" >> .npmrc
8592

8693
- name: Install dependencies
87-
run: npm install --legacy-peer-deps
88-
env:
89-
GITHUB_ACTIONS: true
94+
run: npm install
9095

9196
- name: Clone submodule
9297
run: git clone --recurse-submodules https://github.com/IgniteUI/igniteui-live-editing-samples igniteui-live-editing-samples
9398

9499
- name: Checkout branch in submodule (vNext)
95-
if: env.BRANCH_REF == 'refs/heads/vnext'
100+
if: ${{ env.BRANCH_REF == 'refs/heads/vnext' }}
96101
run: |
97102
cd igniteui-live-editing-samples
98103
git checkout vNext
99104
100105
- name: Checkout branch in submodule (master)
101-
if: env.BRANCH_REF == 'refs/heads/master'
106+
if: ${{ env.BRANCH_REF == 'refs/heads/master' }}
102107
run: |
103108
cd igniteui-live-editing-samples
104109
git checkout master
105110
106111
- name: Update package.json with base href
107112
run: |
108-
sed -i 's/--configuration production/--base-href=${{ matrix.base_href }} --configuration production/g' package.json
113+
sed -i 's|--configuration production|--base-href=${{ matrix.base_href }} --configuration production|g' package.json
109114
110115
- name: Generate live-editing
111116
run: npm ${{ matrix.custom_command }}
@@ -115,9 +120,7 @@ jobs:
115120
npx --userconfig=./.npmrc ng g @igniteui/angular-schematics:upgrade-packages --skip-install
116121
117122
- name: Install dependencies after schematics
118-
run: npm install --legacy-peer-deps
119-
env:
120-
GITHUB_ACTIONS: true
123+
run: npm install
121124

122125
- name: Build application
123126
run: npm ${{ matrix.npm_build_command }} --userconfig=./.npmrc
@@ -144,35 +147,32 @@ jobs:
144147
- name: Create zip artifact
145148
run: |
146149
cd ${{ matrix.target_folder }}/browser
147-
zip -r ../../${{ matrix.submodule_dir }}-artifact.zip ./
150+
zip -r ${{ github.workspace }}/${{ matrix.base_href }}-artifact.zip ./
148151
149152
- name: Upload artifact
150153
uses: actions/upload-artifact@v4
151154
with:
152-
name: ${{ matrix.submodule_dir }}-artifact
153-
path: ${{ matrix.submodule_dir }}-artifact.zip
155+
name: ${{ matrix.base_href }}-artifact
156+
path: ${{ matrix.base_href }}-artifact.zip
157+
retention-days: 1
154158

155159
- name: Repositorify (vNext)
156-
if: env.BRANCH_REF == 'refs/heads/vnext' && matrix.repositoryfy == true
160+
if: ${{ env.BRANCH_REF == 'refs/heads/vnext' && matrix.repositoryfy == true }}
157161
run: npm run ${{ matrix.repositoryfy_command }}
158162

159163
- name: Repositorify (Production)
160-
if: env.BRANCH_REF == 'refs/heads/master' && matrix.repositoryfy == true
164+
if: ${{ env.BRANCH_REF == 'refs/heads/master' && matrix.repositoryfy == true }}
161165
run: npm run ${{ matrix.repositoryfy_command }}:prod
162166

163-
- name: Stage changes
164-
if: matrix.repositoryfy == true
165-
run: |
166-
cd igniteui-live-editing-samples/${{ matrix.submodule_dir }}
167-
git add .
168-
169167
- name: Check for changes
170168
if: matrix.repositoryfy == true
171169
id: check_changes
172170
run: |
173171
cd igniteui-live-editing-samples/${{ matrix.submodule_dir }}
174-
if [ -n "$(git status --porcelain)" ]; then
172+
if [ -n "$(git status --porcelain .)" ]; then
175173
echo "changes_detected=true" >> $GITHUB_OUTPUT
174+
echo "Changed files:"
175+
git status --porcelain .
176176
else
177177
echo "changes_detected=false" >> $GITHUB_OUTPUT
178178
echo "No changes to commit."
@@ -184,32 +184,35 @@ jobs:
184184
cd igniteui-live-editing-samples/${{ matrix.submodule_dir }}
185185
git config --global user.name "github-actions[bot]"
186186
git config --global user.email "github-actions[bot]@users.noreply.github.com"
187+
git add .
187188
git commit -m "Automated repository update"
189+
continue-on-error: true
188190

189191
- name: Push changes
190192
if: matrix.repositoryfy == true && steps.check_changes.outputs.changes_detected == 'true'
191193
run: |
192194
cd igniteui-live-editing-samples/${{ matrix.submodule_dir }}
193-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/IgniteUI/igniteui-live-editing-samples.git
195+
git push https://x-access-token:${{ secrets.CLASSIC_PAT_GITHUB }}@github.com/IgniteUI/igniteui-live-editing-samples.git
194196
continue-on-error: true
195197

196198
- name: Trigger Deploy Workflow in IgniteUI Actions
197199
uses: actions/github-script@v8
198200
with:
199-
github-token: ${{ secrets.CLASSIC_PATKA }}
201+
github-token: ${{ secrets.CLASSIC_PAT_GITHUB }}
200202
script: |
201203
await github.rest.repos.createDispatchEvent({
202204
owner: 'IgniteUI',
203205
repo: 'igniteui-actions',
204206
event_type: 'igniteui-angular-samples-cd',
205207
client_payload: {
208+
calling_branch: "${{ env.BRANCH_REF }}",
206209
repository: "${{ github.repository }}",
207210
run_id: "${{ github.run_id }}",
208211
artifact_name: "${{ matrix.submodule_dir }}-artifact",
212+
base_href: "${{ matrix.base_href }}",
213+
submodule_dir: "${{ matrix.submodule_dir }}",
209214
ref: "${{ github.ref }}",
210215
sha: "${{ github.sha }}",
211216
branch: '${{ github.ref_name }}',
212-
unit: false,
213-
integration: true
214217
}
215218
});

.github/workflows/deploy-trigger.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

azure-devops/app-cd.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
trigger:
2-
branches:
3-
include:
4-
- master
5-
- vnext
1+
trigger: none
62

73
# This pipeline is meant to build specific branches for deployment. It's not meant to be a part of PR validation. Ensure that this pipeline is reserved for deployment purposes.
84
pr: none

azure-devops/app-crm-cd.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
trigger:
2-
branches:
3-
include:
4-
- master
5-
- vnext
1+
trigger: none
62

73
# This pipeline is meant to build specific branches for deployment. It's not meant to be a part of PR validation. Ensure that this pipeline is reserved for deployment purposes.
84
pr: none

azure-devops/app-lob-cd.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
trigger:
2-
branches:
3-
include:
4-
- master
5-
- vnext
1+
trigger: none
62

73
# This pipeline is meant to build specific branches for deployment. It's not meant to be a part of PR validation. Ensure that this pipeline is reserved for deployment purposes.
84
pr: none

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
trigger: none
2+
13
pool:
24
vmImage: 'ubuntu-latest'
35

0 commit comments

Comments
 (0)