|
name: Pull Request |
|
|
|
on: |
|
pull_request: |
|
types: [opened, synchronize, reopened] |
|
|
|
concurrency: |
|
group: ${{ github.workflow }}-${{ github.ref }} |
|
cancel-in-progress: true |
|
|
|
permissions: {} |
|
|
|
defaults: |
|
run: |
|
shell: bash |
|
|
|
jobs: |
|
analyze: |
|
runs-on: ubuntu-latest |
|
outputs: |
|
snapshots: ${{ steps.filter.outputs.snapshots }} |
|
steps: |
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
persist-credentials: false |
|
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 |
|
id: filter |
|
with: |
|
filters: | |
|
snapshots: |
|
- 'tests/e2e/ng-snapshot/package.json' |
|
|
|
lint: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup ESLint Caching |
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
|
with: |
|
path: .eslintcache |
|
key: ${{ runner.os }}-${{ hashFiles('.eslintrc.json') }} |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Generate JSON schema types |
|
# Schema types are required to correctly lint the TypeScript code |
|
run: pnpm run build-schema |
|
- name: Run ESLint |
|
run: pnpm lint --cache-strategy content |
|
- name: Validate NgBot Configuration |
|
run: pnpm ng-dev ngbot verify |
|
- name: Validate Circular Dependencies |
|
run: pnpm ts-circular-deps check |
|
- name: Run Validation |
|
run: pnpm admin validate |
|
- name: Check tooling setup |
|
run: pnpm check-tooling-setup |
|
- name: Check commit message |
|
# Commit message validation is only done on pull requests as its too late to validate once |
|
# it has been merged. |
|
run: pnpm ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} |
|
- name: Check code format |
|
# Code formatting checks are only done on pull requests as its too late to validate once |
|
# it has been merged. |
|
run: pnpm ng-dev format changed --check ${{ github.event.pull_request.base.sha }} |
|
- name: Check Package Licenses |
|
uses: angular/dev-infra/github-actions/linting/licenses@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
|
|
build: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel RBE |
|
uses: angular/dev-infra/github-actions/bazel/configure-remote@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Build release targets |
|
run: pnpm ng-dev release build |
|
- name: Store PR release packages |
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
|
with: |
|
name: packages |
|
path: dist/releases/*.tgz |
|
retention-days: 14 |
|
|
|
test: |
|
needs: build |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel RBE |
|
uses: angular/dev-infra/github-actions/bazel/configure-remote@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Run module and package tests |
|
run: pnpm bazel test -- //... -//tests/... |
|
|
|
e2e: |
|
needs: build |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
node: [22] |
|
subset: [esbuild, webpack] |
|
shard: [0, 1, 2, 3, 4, 5] |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel RBE |
|
uses: angular/dev-infra/github-actions/bazel/configure-remote@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Run CLI E2E tests |
|
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }} |
|
|
|
build-e2e-windows-subset: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel RBE |
|
uses: angular/dev-infra/github-actions/bazel/configure-remote@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Build E2E tests for Windows on Linux |
|
run: | |
|
pnpm bazel build \ |
|
--config=e2e \ |
|
//tests:e2e.esbuild_node24 \ |
|
--platforms=tools:windows_x64 |
|
- name: Store built Windows E2E tests |
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
|
with: |
|
name: win-e2e-build-artifacts |
|
path: | |
|
dist/bin/tests/** |
|
!**/node_modules/** |
|
retention-days: 1 |
|
if-no-files-found: 'error' |
|
|
|
e2e-windows-subset: |
|
needs: build-e2e-windows-subset |
|
runs-on: windows-2025 |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Download built Windows E2E tests |
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
|
with: |
|
name: win-e2e-build-artifacts |
|
path: dist/bin/tests/ |
|
- name: Run CLI E2E tests |
|
uses: ./.github/shared-actions/windows-bazel-test |
|
with: |
|
test_target_name: e2e.esbuild_node24 |
|
env: |
|
E2E_SHARD_TOTAL: 1 |
|
TESTBRIDGE_TEST_ONLY: tests/basic/{build,rebuild,serve}.ts |
|
|
|
e2e-package-managers: |
|
needs: build |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
node: [22] |
|
subset: [yarn, pnpm, bun] |
|
shard: [0, 1, 2] |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel RBE |
|
uses: angular/dev-infra/github-actions/bazel/configure-remote@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Run CLI E2E tests |
|
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.${{ matrix.subset }}_node${{ matrix.node }} |
|
|
|
e2e-snapshots: |
|
needs: [analyze, build] |
|
if: needs.analyze.outputs.snapshots == 'true' |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
node: [22] |
|
subset: [esbuild, webpack] |
|
shard: [0, 1, 2, 3, 4, 5] |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Initialize environment |
|
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Install node modules |
|
run: pnpm install --frozen-lockfile |
|
- name: Setup Bazel |
|
uses: angular/dev-infra/github-actions/bazel/setup@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Setup Bazel RBE |
|
uses: angular/dev-infra/github-actions/bazel/configure-remote@fa43fd2864c3bec677cd47f4e095370850cdf8bc # main |
|
- name: Run CLI E2E tests |
|
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} |