Skip to content

mayurrawte/github-angular-actions

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Angular Setup — GitHub Action

MIT License Test Action GitHub Marketplace Platforms

One step. Set up Node.js, cache your package manager, and install Angular CLI. Works with npm, yarn, and pnpm — no boilerplate required.


Quick start

- uses: mayurrawte/github-angular-actions@v2

Installs the latest Angular CLI on Node 22 with npm caching. Zero config.


Inputs

Input Default Description
version latest Angular CLI version — e.g. 17.3.8, 18.0.0, or latest
node-version 22 Node.js version — e.g. 22, 20, 18
package-manager npm npm, yarn, or pnpm
cache-dependency-path (repo root) Lock file path for monorepos
cache true Set to false to disable package manager caching

Outputs

Output Description
cli-version Installed Angular CLI version, e.g. 17.3.8

Examples

Default — latest Angular, Node 22, npm

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
  - run: npm ci
  - run: npm run build

Pin Angular CLI and Node versions

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
    with:
      version: '17.3.8'
      node-version: '20'
  - run: npm ci
  - run: npm test -- --watch=false --browsers=ChromeHeadless

Angular 16+ with Jest

Angular 16 and above supports Jest as the test runner. No extra setup needed — just run your test command after the action:

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
    with:
      version: 'latest'
      node-version: '22'
  - run: npm ci
  - run: npm test  # runs Jest if configured via ng generate jest

pnpm

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
    with:
      node-version: '22'
      package-manager: 'pnpm'
  - run: pnpm install
  - run: pnpm build

yarn

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
    with:
      node-version: '22'
      package-manager: 'yarn'
  - run: yarn install --frozen-lockfile
  - run: yarn build

Monorepo — lock file in a subdirectory

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
    with:
      package-manager: 'npm'
      cache-dependency-path: 'packages/app/package-lock.json'
  - run: npm ci --workspace=packages/app

Use the cli-version output downstream

steps:
  - uses: actions/checkout@v4
  - uses: mayurrawte/github-angular-actions@v2
    id: ng-setup
  - run: echo "Running on Angular CLI ${{ steps.ng-setup.outputs.cli-version }}"

Why this action?

Feature This action actions/setup-node only
Installs Angular CLI globally
Specific CLI version
Node.js version selection
npm caching
pnpm caching ✅ (manual config)
yarn caching ✅ (manual config)
Monorepo lock file path ✅ (manual config)
Exposes cli-version output
Zero config ❌ (need extra step)

Use this action when @angular/cli is not in your devDependencies — common in legacy projects, shared runner setups, or anywhere you run ng directly in CI scripts.


License

MIT

About

GitHub Action to preinstall angular-cli and other dependencies. You can configure ng versions.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Contributors