fix(ci): use npx ng for Angular CLI commands #114
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and test | |
| on: | |
| push: | |
| branches: [main, big-update] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: src/package-lock.json | |
| - name: Build and test | |
| working-directory: src | |
| run: | | |
| npm ci | |
| npm run build | |
| npm run test | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: src/dist | |
| retention-days: 1 | |
| # Test ng add and ng deploy across multiple Angular versions (sequentially) | |
| # This catches breaking changes in angular.json structure | |
| # Each test creates its own git repo and deploys locally to verify the full flow | |
| test-angular-versions: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Configure git | |
| run: | | |
| git config --global user.name "CI Bot" | |
| git config --global user.email "ci@test.local" | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Link angular-cli-ghpages | |
| working-directory: dist | |
| run: npm link | |
| - name: Test Angular 18 | |
| run: | | |
| cd /tmp | |
| npx @angular/cli@18 new test-app-18 --defaults | |
| cd test-app-18 | |
| npm link angular-cli-ghpages | |
| npx ng add angular-cli-ghpages | |
| npx ng deploy | |
| git branch -a | grep gh-pages | |
| echo "Angular 18: build + deploy successful" | |
| - name: Test Angular 19 | |
| run: | | |
| cd /tmp | |
| npx @angular/cli@19 new test-app-19 --defaults | |
| cd test-app-19 | |
| npm link angular-cli-ghpages | |
| npx ng add angular-cli-ghpages | |
| npx ng deploy | |
| git branch -a | grep gh-pages | |
| echo "Angular 19: build + deploy successful" | |
| - name: Test Angular 20 | |
| run: | | |
| cd /tmp | |
| npx @angular/cli@20 new test-app-20 --defaults | |
| cd test-app-20 | |
| npm link angular-cli-ghpages | |
| npx ng add angular-cli-ghpages | |
| npx ng deploy | |
| git branch -a | grep gh-pages | |
| echo "Angular 20: build + deploy successful" | |
| - name: Test Angular 21 | |
| run: | | |
| cd /tmp | |
| npx @angular/cli@21 new test-app-21 --defaults | |
| cd test-app-21 | |
| npm link angular-cli-ghpages | |
| npx ng add angular-cli-ghpages | |
| npx ng deploy | |
| git branch -a | grep gh-pages | |
| echo "Angular 21: build + deploy successful" |