Skip to content

Commit ee06be7

Browse files
committed
chore(ci): Add Angular version matrix to CI
1 parent 5379082 commit ee06be7

2 files changed

Lines changed: 51 additions & 3 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@ on:
88

99
jobs:
1010
test:
11-
name: Test
11+
name: Test (Angular ${{ matrix.angular-major }})
1212
timeout-minutes: 60
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- angular-major: "20"
19+
angular-version: "^20.3.11"
20+
- angular-major: "21"
21+
angular-version: "^21.0.0"
22+
- angular-major: "22"
23+
angular-version: "^22.0.0"
1424
steps:
1525
- name: PNPM Setup
1626
uses: pnpm/action-setup@v6
@@ -25,8 +35,13 @@ jobs:
2535
node-version: "22.23.1"
2636
cache: "pnpm"
2737

38+
- name: Set Angular test version
39+
run: node scripts/set-angular-version.js
40+
env:
41+
ANGULAR_VERSION: ${{ matrix.angular-version }}
42+
2843
- name: Install dependencies
29-
run: pnpm install --frozen-lockfile
44+
run: pnpm install --no-frozen-lockfile
3045

3146
- name: Get Playwright version
3247
id: versions
@@ -45,7 +60,7 @@ jobs:
4560
- uses: actions/upload-artifact@v7
4661
if: always()
4762
with:
48-
name: playwright-report
63+
name: playwright-report-angular-${{ matrix.angular-version }}
4964
path: ./*/**/playwright-report/
5065
retention-days: 30
5166

‎scripts/set-angular-version.js‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const fs = require('fs');
2+
3+
const angularVersion = process.env.ANGULAR_VERSION;
4+
5+
if (!angularVersion) {
6+
throw new Error('ANGULAR_VERSION must be set');
7+
}
8+
9+
const path = 'ct-angular/package.json';
10+
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
11+
const angularDeps = [
12+
'@angular/animations',
13+
'@angular/common',
14+
'@angular/compiler',
15+
'@angular/core',
16+
'@angular/forms',
17+
'@angular/platform-browser',
18+
'@angular/platform-browser-dynamic',
19+
'@angular/router',
20+
];
21+
const angularDevDeps = [
22+
'@angular-devkit/build-angular',
23+
'@angular/cli',
24+
'@angular/compiler-cli',
25+
];
26+
27+
for (const name of angularDeps)
28+
pkg.dependencies[name] = angularVersion;
29+
30+
for (const name of angularDevDeps)
31+
pkg.devDependencies[name] = angularVersion;
32+
33+
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');

0 commit comments

Comments
 (0)