From 8f05bcccfe381a02671fd283ee68b220663fb879 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 8 Jan 2025 08:35:17 -0700 Subject: [PATCH 1/4] refactor: move material.aio GHA to the root This makes them functional again. To keep this change simple, we just update the working directory but run the same things --- .../workflows/ci.material-aio.yml | 5 +++-- .../workflows/pr.material-aio.yml | 3 ++- .../.github/ISSUE_TEMPLATE/docs-infra.md | 17 ----------------- 3 files changed, 5 insertions(+), 20 deletions(-) rename material.angular.io/.github/workflows/ci.yml => .github/workflows/ci.material-aio.yml (93%) rename material.angular.io/.github/workflows/pr.yml => .github/workflows/pr.material-aio.yml (96%) delete mode 100644 material.angular.io/.github/ISSUE_TEMPLATE/docs-infra.md diff --git a/material.angular.io/.github/workflows/ci.yml b/.github/workflows/ci.material-aio.yml similarity index 93% rename from material.angular.io/.github/workflows/ci.yml rename to .github/workflows/ci.material-aio.yml index ed784b25c86e..00c461440c09 100644 --- a/material.angular.io/.github/workflows/ci.yml +++ b/.github/workflows/ci.material-aio.yml @@ -1,4 +1,4 @@ -name: CI +name: 'CI (material.angular.io)' on: push: @@ -15,6 +15,7 @@ permissions: {} defaults: run: shell: bash + working-directory: material.angular.io env: # TODO: Remove when pnpm is exclusively used. @@ -67,7 +68,7 @@ jobs: - name: Install node modules run: yarn install --immutable - name: Execute Lighthouse Audit - run: yarn bazel test --test_tag_filters=audit //... + run: yarn bazel test --test_tag_filters=audit --test_output=errors //... - name: Store Audit Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 with: diff --git a/material.angular.io/.github/workflows/pr.yml b/.github/workflows/pr.material-aio.yml similarity index 96% rename from material.angular.io/.github/workflows/pr.yml rename to .github/workflows/pr.material-aio.yml index 27110a555aee..44e75c8ae376 100644 --- a/material.angular.io/.github/workflows/pr.yml +++ b/.github/workflows/pr.material-aio.yml @@ -1,4 +1,4 @@ -name: Pull Request +name: 'CI (material.angular.io)' on: pull_request: @@ -13,6 +13,7 @@ permissions: {} defaults: run: shell: bash + working-directory: material.angular.io env: # TODO: Remove when pnpm is exclusively used. diff --git a/material.angular.io/.github/ISSUE_TEMPLATE/docs-infra.md b/material.angular.io/.github/ISSUE_TEMPLATE/docs-infra.md deleted file mode 100644 index 2318b6b5f8db..000000000000 --- a/material.angular.io/.github/ISSUE_TEMPLATE/docs-infra.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Docs Infrastructure -about: Suggest an improvement to the infrastructure used to build material.angular.io ---- - - From 088cadcf0ca7fab29ad516927539dd6374caf470 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 8 Jan 2025 09:29:26 -0700 Subject: [PATCH 2/4] refactor: upload testlogs when test step fails --- .github/workflows/ci.material-aio.yml | 8 +++++--- .github/workflows/pr.material-aio.yml | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.material-aio.yml b/.github/workflows/ci.material-aio.yml index 00c461440c09..5e8ca7a26c3a 100644 --- a/.github/workflows/ci.material-aio.yml +++ b/.github/workflows/ci.material-aio.yml @@ -55,9 +55,10 @@ jobs: run: yarn bazel test --test_tag_filters=-lint,-e2e,-audit //... - name: Store Test Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + if: always() with: name: test-logs - path: bazel-testlogs/ + path: material.angular.io/bazel-testlogs/ retention-days: 14 lighthouse: @@ -68,10 +69,11 @@ jobs: - name: Install node modules run: yarn install --immutable - name: Execute Lighthouse Audit - run: yarn bazel test --test_tag_filters=audit --test_output=errors //... + run: yarn bazel test --test_tag_filters=audit //... - name: Store Audit Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + if: always() with: name: lighthouse-logs - path: bazel-testlogs/ + path: material.angular.io/bazel-testlogs/ retention-days: 14 diff --git a/.github/workflows/pr.material-aio.yml b/.github/workflows/pr.material-aio.yml index 44e75c8ae376..2836f9d6e862 100644 --- a/.github/workflows/pr.material-aio.yml +++ b/.github/workflows/pr.material-aio.yml @@ -53,9 +53,10 @@ jobs: run: yarn bazel test --test_tag_filters=-lint,-e2e,-audit //... - name: Store Test Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + if: always() with: name: test-logs - path: bazel-testlogs/ + path: material.angular.io/bazel-testlogs/ retention-days: 14 lighthouse: @@ -69,7 +70,8 @@ jobs: run: yarn bazel test --test_tag_filters=audit //... - name: Store Audit Logs uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + if: always() with: name: lighthouse-logs - path: bazel-testlogs/ + path: material.angular.io/bazel-testlogs/ retention-days: 14 From 233670c6e47eec8cfc127a35d40ea8c8c7a78ff9 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 8 Jan 2025 10:13:00 -0700 Subject: [PATCH 3/4] refactor: pin chromium test to same Ubuntu as before See last passing job in old repo: https://github.com/angular/material.angular.io/actions/runs/12390917032/job/34586949768 --- .github/workflows/ci.material-aio.yml | 2 +- .github/workflows/pr.material-aio.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.material-aio.yml b/.github/workflows/ci.material-aio.yml index 5e8ca7a26c3a..7b03d3addff9 100644 --- a/.github/workflows/ci.material-aio.yml +++ b/.github/workflows/ci.material-aio.yml @@ -62,7 +62,7 @@ jobs: retention-days: 14 lighthouse: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # Note, fails on Ubuntu 24.04, see https://github.com/actions/runner-images/issues/10636 steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@359350bbc10aab1bac85d0eec61a53377078ab82 diff --git a/.github/workflows/pr.material-aio.yml b/.github/workflows/pr.material-aio.yml index 2836f9d6e862..cdc30043de5f 100644 --- a/.github/workflows/pr.material-aio.yml +++ b/.github/workflows/pr.material-aio.yml @@ -60,7 +60,7 @@ jobs: retention-days: 14 lighthouse: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # Note, fails on Ubuntu 24.04, see https://github.com/actions/runner-images/issues/10636 steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@359350bbc10aab1bac85d0eec61a53377078ab82 From b1812e2ed3dcfd4660f2f9a26c25a8298ec1e7b3 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 8 Jan 2025 10:32:39 -0700 Subject: [PATCH 4/4] refactor: only trigger material.aio workflows when files touched in that folder --- .github/workflows/ci.material-aio.yml | 4 +++- .github/workflows/pr.material-aio.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.material-aio.yml b/.github/workflows/ci.material-aio.yml index 7b03d3addff9..744cbdd5e87f 100644 --- a/.github/workflows/ci.material-aio.yml +++ b/.github/workflows/ci.material-aio.yml @@ -5,6 +5,8 @@ on: branches: - main - '[0-9]+.[0-9]+.x' + paths: + - 'material.angular.io/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -62,7 +64,7 @@ jobs: retention-days: 14 lighthouse: - runs-on: ubuntu-22.04 # Note, fails on Ubuntu 24.04, see https://github.com/actions/runner-images/issues/10636 + runs-on: ubuntu-22.04 # Note, fails on Ubuntu 24.04. see https://github.com/actions/runner-images/issues/10636 steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@359350bbc10aab1bac85d0eec61a53377078ab82 diff --git a/.github/workflows/pr.material-aio.yml b/.github/workflows/pr.material-aio.yml index cdc30043de5f..79e87d497071 100644 --- a/.github/workflows/pr.material-aio.yml +++ b/.github/workflows/pr.material-aio.yml @@ -3,6 +3,8 @@ name: 'CI (material.angular.io)' on: pull_request: types: [opened, synchronize, reopened] + paths: + - 'material.angular.io/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -60,7 +62,7 @@ jobs: retention-days: 14 lighthouse: - runs-on: ubuntu-22.04 # Note, fails on Ubuntu 24.04, see https://github.com/actions/runner-images/issues/10636 + runs-on: ubuntu-22.04 # Note, fails on Ubuntu 24.04. see https://github.com/actions/runner-images/issues/10636 steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@359350bbc10aab1bac85d0eec61a53377078ab82