Skip to content

Commit 9d62787

Browse files
committed
ci: add Angular version matrix test (18, 19, 20, 21)
Test ng add and ng deploy across multiple Angular versions to catch breaking changes in angular.json structure. Each version creates its own local git repo and performs a full build + deploy cycle. This replaces the single-version test that missed the Angular 20+ outputPath change.
1 parent 970c5d0 commit 9d62787

File tree

1 file changed

+75
-15
lines changed

1 file changed

+75
-15
lines changed

.github/workflows/main.yml

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55
branches: [main, big-update]
66

77
jobs:
8-
build-test-and-deploy:
8+
build-and-test:
99
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/checkout@v4
1313

1414
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 24
16+
node-version: 22
1717
cache: npm
1818
cache-dependency-path: src/package-lock.json
1919

@@ -24,20 +24,80 @@ jobs:
2424
npm run build
2525
npm run test
2626
27-
- name: Verify ng add works
27+
- name: Upload build artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: dist
31+
path: src/dist
32+
retention-days: 1
33+
34+
# Test ng add and ng deploy across multiple Angular versions (sequentially)
35+
# This catches breaking changes in angular.json structure
36+
# Each test creates its own git repo and deploys locally to verify the full flow
37+
test-angular-versions:
38+
needs: build-and-test
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
46+
- name: Configure git
47+
run: |
48+
git config --global user.name "CI Bot"
49+
git config --global user.email "ci@test.local"
50+
51+
- name: Download build artifact
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: dist
55+
path: dist
56+
57+
- name: Link angular-cli-ghpages
58+
working-directory: dist
59+
run: npm link
60+
61+
- name: Test Angular 18
62+
run: |
63+
cd /tmp
64+
npx @angular/cli@18 new test-app-18 --defaults
65+
cd test-app-18
66+
npm link angular-cli-ghpages
67+
ng add angular-cli-ghpages
68+
ng deploy
69+
git branch -a | grep gh-pages
70+
echo "Angular 18: build + deploy successful"
71+
72+
- name: Test Angular 19
73+
run: |
74+
cd /tmp
75+
npx @angular/cli@19 new test-app-19 --defaults
76+
cd test-app-19
77+
npm link angular-cli-ghpages
78+
ng add angular-cli-ghpages
79+
ng deploy
80+
git branch -a | grep gh-pages
81+
echo "Angular 19: build + deploy successful"
82+
83+
- name: Test Angular 20
2884
run: |
29-
cd src/dist && npm link && cd ../..
30-
npm install -g @angular/cli
31-
ng new test-app --defaults
32-
cd test-app
85+
cd /tmp
86+
npx @angular/cli@20 new test-app-20 --defaults
87+
cd test-app-20
3388
npm link angular-cli-ghpages
3489
ng add angular-cli-ghpages
90+
ng deploy
91+
git branch -a | grep gh-pages
92+
echo "Angular 20: build + deploy successful"
3593
36-
# CI test only: Verifies that the gh-pages branch gets updated
37-
# This is NOT a production deployment - there is no public website for angular-cli-ghpages
38-
- name: Deploy
39-
if: github.ref == 'refs/heads/main'
40-
working-directory: test-app
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
run: ng deploy --name="The Buildbot" --email="buildbot@angular2buch.de" --cname=angular-cli-ghpages.angular.schule
94+
- name: Test Angular 21
95+
run: |
96+
cd /tmp
97+
npx @angular/cli@21 new test-app-21 --defaults
98+
cd test-app-21
99+
npm link angular-cli-ghpages
100+
ng add angular-cli-ghpages
101+
ng deploy
102+
git branch -a | grep gh-pages
103+
echo "Angular 21: build + deploy successful"

0 commit comments

Comments
 (0)