diff --git a/.github/workflows/ci.material-aio.yml b/.github/workflows/ci.material-aio.yml index cb8f4bc69f54..a9758e5e6318 100644 --- a/.github/workflows/ci.material-aio.yml +++ b/.github/workflows/ci.material-aio.yml @@ -5,8 +5,6 @@ on: branches: - main - '[0-9]+.[0-9]+.x' - paths: - - 'material.angular.io/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -18,42 +16,48 @@ defaults: run: shell: bash -env: - # TODO: Remove when pnpm is exclusively used. - ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1' - jobs: lint: runs-on: ubuntu-latest steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Linting - run: pnpm --cwd=docs bazel test --test_tag_filters=lint //... + run: pnpm bazel test --test_tag_filters=lint //docs/... build: runs-on: ubuntu-latest steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - - name: Execute Direct Production Build (deploy usage) - run: pnpm -s --cwd=docs prod-build - - name: Execute Build via Bazel - run: pnpm -s --cwd=docs bazel build //... + - name: Execute Build + run: pnpm -s build //docs/... test: runs-on: ubuntu-latest steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Tests - run: pnpm --cwd=docs bazel test --test_tag_filters=-lint,-e2e,-audit //... + run: pnpm bazel test --test_tag_filters=-lint,-e2e,-audit //docs/... - name: Store Test Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 if: always() @@ -67,10 +71,14 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Lighthouse Audit - run: pnpm -s --cwd=docs bazel test --test_tag_filters=audit //... + run: pnpm -s bazel test --test_tag_filters=audit //docs/... - name: Store Audit Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 if: always() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31f776181797..f41042b0b4d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,8 +183,6 @@ jobs: run: pnpm install --frozen-lockfile - name: Run tests run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... - env: - ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1' - uses: ./.github/actions/slack if: failure() with: diff --git a/.github/workflows/pr.material-aio.yml b/.github/workflows/pr.material-aio.yml index 4c946c5349ff..74ddd6b2a426 100644 --- a/.github/workflows/pr.material-aio.yml +++ b/.github/workflows/pr.material-aio.yml @@ -1,10 +1,8 @@ -name: 'CI (material.angular.io)' +name: 'PR (material.angular.io)' on: pull_request: types: [opened, synchronize, reopened] - paths: - - 'material.angular.io/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,16 +14,16 @@ defaults: run: shell: bash -env: - # TODO: Remove when pnpm is exclusively used. - ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1' - jobs: lint: runs-on: ubuntu-latest steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Linting @@ -36,6 +34,10 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Build @@ -46,6 +48,10 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Tests @@ -63,6 +69,10 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@e4bf37af223483ce00f9316d227fd62cd744dc4b + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@e4bf37af223483ce00f9316d227fd62cd744dc4b - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Lighthouse Audit diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2fc5ee8ca67e..c65f0bffcbc1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -146,8 +146,6 @@ jobs: run: pnpm install --frozen-lockfile - name: Run tests run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... - env: - ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1' build: runs-on: ubuntu-latest-16core diff --git a/WORKSPACE b/WORKSPACE index 7fc3ff17775d..021755625a1c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,14 +3,6 @@ workspace( name = "angular_material", ) -# Point to the nested WORKSPACE we merged from github.com/angular/material.angular.io -# NB: even though this isn't referenced anywhere, it's required for Bazel to know about the -# nested workspace so that wildcard patterns like //... don't descend into it. -local_repository( - name = "material_angular_io", - path = "./material.angular.io", -) - load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Add NodeJS rules diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 8e5a86864dc9..558e37aeaf2a 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -1,5 +1,5 @@ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") -load("@aspect_rules_js//js:defs.bzl", "js_test") +load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_library", "js_test") load("@npm2//:defs.bzl", "npm_link_all_packages") load("//docs:defs.bzl", "ng_app") @@ -46,14 +46,13 @@ ng_app( ], ) -js_test( - name = "audit", - args = [ - "$(location //docs:build.production)", +js_library( + name = "audit_lib", + srcs = [ + "tools/audit-docs.js", + "tools/lighthouse-audit.mjs", ], data = [ - "tools/lighthouse-audit.mjs", - "//docs:build.production", "//docs:node_modules/light-server", "//docs:node_modules/lighthouse", "//docs:node_modules/lighthouse-logger", @@ -61,6 +60,29 @@ js_test( "//docs:node_modules/shelljs", "@rules_browsers//src/browsers/chromium", ], +) + +js_binary( + name = "audit_tool", + data = [":audit_lib"], + entry_point = "tools/audit-docs.js", + env = { + "CHROMIUM_BIN": "$(CHROME-HEADLESS-SHELL)", + }, + toolchains = [ + "@rules_browsers//src/browsers/chromium:toolchain_alias", + ], +) + +js_test( + name = "audit", + args = [ + "$(location //docs:build.production)", + ], + data = [ + ":audit_lib", + "//docs:build.production", + ], entry_point = "tools/audit-docs.js", env = { "CHROMIUM_BIN": "$(CHROME-HEADLESS-SHELL)", diff --git a/scripts/docs-deploy/monitoring/index.mts b/scripts/docs-deploy/monitoring/index.mts index 72aee8445f7b..a5871683f883 100644 --- a/scripts/docs-deploy/monitoring/index.mts +++ b/scripts/docs-deploy/monitoring/index.mts @@ -9,9 +9,7 @@ import {projectDir, sites} from '../utils.mjs'; * specified remote URL is properly functioning. */ export async function runMonitorTests(remoteUrl: string) { - cd(path.join(projectDir, 'docs')); - - await $`node ./tools/audit-docs.js ${remoteUrl}`; + await $`pnpm bazel run //docs:audit_tool -- ${remoteUrl}`; } /** Runs the monitoring tests for the stable release train. */