From 29c710ddd55d2b74636fd722f5a136164c31d15b Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Fri, 6 Oct 2023 17:53:57 +0000 Subject: [PATCH] ci: migrate docs site monitoring to Github Actions Move doc site monitoring from CircleCI to Github Actions, additionally runs the tests every 4 hours instead of once per hour. (cherry picked from commit e099c3728c7194226ffcc156332ea5f669c28e76) --- .circleci/config.yml | 34 ------------------------------ .github/workflows/scheduled-ci.yml | 30 +++++++++++++++++++++----- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7aa2c57333e5..b3cd6e6c58d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 # ---------------------------------------- @@ -339,21 +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: - - 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 diff --git a/.github/workflows/scheduled-ci.yml b/.github/workflows/scheduled-ci.yml index 9c256c4c7d60..ff6d623f5399 100644 --- a/.github/workflows/scheduled-ci.yml +++ b/.github/workflows/scheduled-ci.yml @@ -2,7 +2,7 @@ name: Scheduled CI on: schedule: - - cron: '0 0/4 * * *' + - cron: '0 0/4 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -27,7 +27,7 @@ jobs: - 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 + # 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 @@ -55,7 +55,7 @@ jobs: - 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 + # 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 @@ -85,7 +85,7 @@ jobs: - 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 + # 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 @@ -101,4 +101,24 @@ jobs: 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 }} \ No newline at end of file + 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 }}