diff --git a/.github/workflows/ci.material-aio.yml b/.github/workflows/ci.material-aio.yml index cb8f4bc69f54..5f3e95d96ae1 100644 --- a/.github/workflows/ci.material-aio.yml +++ b/.github/workflows/ci.material-aio.yml @@ -18,16 +18,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Linting @@ -38,11 +38,13 @@ 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@e4bf37af223483ce00f9316d227fd62cd744dc4 - 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 + - name: Execute Build run: pnpm -s --cwd=docs bazel build //... test: @@ -50,6 +52,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Tests @@ -67,6 +73,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Lighthouse Audit 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..064be73c02d5 100644 --- a/.github/workflows/pr.material-aio.yml +++ b/.github/workflows/pr.material-aio.yml @@ -1,4 +1,4 @@ -name: 'CI (material.angular.io)' +name: 'PR (material.angular.io)' on: pull_request: @@ -16,16 +16,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Linting @@ -36,6 +36,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Build @@ -46,6 +50,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - name: Install node modules run: pnpm install --frozen-lockfile - name: Execute Tests @@ -63,6 +71,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@e4bf37af223483ce00f9316d227fd62cd744dc4 - 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/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. */