Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate snapshots jobs to GHA #27917

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 0 additions & 109 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,6 @@ jobs:
- run: yarn ci-push-deploy-docs-app
- *slack_notify_on_failure

# ----------------------------------------
# Job that monitors the docs site, ensuring
# the docs site is online and works as expected.
# ----------------------------------------
monitor_docs_site:
docker:
- image: *docker-browser-image
resource_class: xlarge
steps:
- checkout_and_rebase
- *restore_cache
- *yarn_install

- run: yarn ci-docs-monitor-test
- *slack_notify_on_failure

# ----------------------------------------
# Job that publishes the build snapshots
# ----------------------------------------
Expand Down Expand Up @@ -309,72 +293,6 @@ jobs:
- run: ./scripts/circleci/publish-snapshots.sh
- *slack_notify_on_failure

# ----------------------------------------------------------------------------
# Job that runs the browser tests against the Angular Github snapshots
# ----------------------------------------------------------------------------
snapshot_tests_browsers:
<<: *job_defaults
resource_class: xlarge
environment:
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
steps:
- checkout_and_rebase
- *restore_cache
- *setup_bazel_ci_config
- *setup_bazel_remote_execution
- *setup_snapshot_builds
- *yarn_install_loose_lockfile
- *setup_bazel_binary

- run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
- *slack_notify_on_failure

# ----------------------------------------------------------------------------
# Job that runs both AOT and JIT linker tests against Angular snapshot builds.
# ----------------------------------------------------------------------------
snapshot_linker_tests:
<<: *job_defaults
resource_class: xlarge
environment:
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
steps:
- checkout_and_rebase
- *restore_cache
- *setup_bazel_ci_config
- *setup_bazel_remote_execution
- *setup_snapshot_builds
- *yarn_install_loose_lockfile
- *setup_bazel_binary

- run: yarn test-linker-aot
- run: yarn test-linker-jit
- *slack_notify_on_failure

# ----------------------------------------------------------------------------
# Job that runs all Bazel tests against material-components-web@canary
# ----------------------------------------------------------------------------
mdc_snapshot_test_cronjob:
<<: *job_defaults
resource_class: xlarge
environment:
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
steps:
- checkout_and_rebase
- *restore_cache
- *yarn_install_loose_lockfile
- *setup_bazel_binary
- *setup_bazel_ci_config
- *setup_bazel_remote_execution
- *yarn_install

# Install the latest canary version of the "material-components-web".
- run: node ./scripts/circleci/setup-mdc-canary.js

# Setup the components repository to use the MDC snapshot builds.
# Run project tests with the MDC canary builds.
- run: bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
- *slack_notify_on_failure

# ----------------------------------------------------------------------------------------
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
# one job depends on another.
Expand Down Expand Up @@ -405,30 +323,3 @@ workflows:
filters: *publish_branches_filter
requires:
- build_release_packages

# Snapshot tests workflow that is scheduled to run all specified jobs every hour.
# This workflow runs various jobs against the Angular snapshot builds from Github.
snapshot_tests:
jobs:
# Note that we need additional jobs for the cronjob snapshot tests because there
# is no easy way to detect whether a job runs inside of a cronjob or specific
# workflow. See: https://circleci.com/ideas/?idea=CCI-I-295
- snapshot_tests_browsers:
filters: *only_main_branch_filter
- mdc_snapshot_test_cronjob:
filters: *only_main_branch_filter
- snapshot_linker_tests:
filters: *only_main_branch_filter
- monitor_docs_site:
filters: *only_main_branch_filter

triggers:
- schedule:
cron: '0 * * * *'
filters:
branches:
only:
# We only want to run the main branch against the snapshot builds because
# it's not guaranteed that older versions of Angular Material always work
# with the latest Angular version.
- main
124 changes: 124 additions & 0 deletions .github/workflows/scheduled-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Scheduled CI

on:
schedule:
- cron: '0 0/4 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

defaults:
run:
shell: bash

jobs:
test_browsers:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fb30926790c6225d553b91a4818cab2fdde4fb4e
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@fb30926790c6225d553b91a4818cab2fdde4fb4e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@fb30926790c6225d553b91a4818cab2fdde4fb4e
- name: Setting up Angular snapshot builds
# Angular snapshots must be set up first so that the yarn install properly
# updates the yarn.lock as expected with the changes
run: node ./scripts/circleci/setup-angular-snapshots.js main
- name: Install node modules
run: yarn install
- name: Run Browser tests
run: yarn bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
- name: Notify about failed test
if: ${{ failure() }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
with:
channel-id: 'C015EBF2XB6'
slack-message: 'Browser snapshot test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
env:
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

linker_tests:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fb30926790c6225d553b91a4818cab2fdde4fb4e
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@fb30926790c6225d553b91a4818cab2fdde4fb4e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@fb30926790c6225d553b91a4818cab2fdde4fb4e
- name: Setting up Angular snapshot builds
# Angular snapshots must be set up first so that the yarn install properly
# updates the yarn.lock as expected with the changes
run: node ./scripts/circleci/setup-angular-snapshots.js main
- name: Install node modules
run: yarn install
- name: Run linker tests using AOT
run: yarn test-linker-aot
- name: Run linker tests using JIT
run: yarn test-linker-jit
- name: Notify about failed test
if: ${{ failure() }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
with:
channel-id: 'C015EBF2XB6'
slack-message: 'Snapshot linker test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
env:
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

mdc_snapshot_test:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fb30926790c6225d553b91a4818cab2fdde4fb4e
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@fb30926790c6225d553b91a4818cab2fdde4fb4e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@fb30926790c6225d553b91a4818cab2fdde4fb4e
- name: Setting up Angular snapshot builds
# Angular snapshots must be set up first so that the yarn install properly
# updates the yarn.lock as expected with the changes
run: node ./scripts/circleci/setup-angular-snapshots.js main
- name: Install MDC Canary
run: node ./scripts/circleci/setup-mdc-canary.js
- name: Install node modules
run: yarn install
- name: Run browser tests using MDC Canary
run: bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
- name: Notify about failed test
if: ${{ failure() }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
with:
channel-id: 'C015EBF2XB6'
slack-message: 'MDC snapshot test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
env:
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

monitor-docs-site:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@fb30926790c6225d553b91a4818cab2fdde4fb4e
with:
cache-node-modules: true
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Check Docs Site
run: yarn ci-docs-monitor-test
- name: Notify about failed test
if: ${{ failure() }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
with:
channel-id: 'C015EBF2XB6'
slack-message: 'Docs site monitoring job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
env:
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
Loading