diff --git a/.circleci/config.yml b/.circleci/config.yml index f1ca2d5f02ba..9454be12fd03 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,434 +1,16 @@ -# Configuration file for https://circleci.com/gh/angular/components +# This config is remaining in place to prevent pull requests failing because of CircleCI config missing. -# Note: YAML anchors allow an object to be re-used, reducing duplication. -# The ampersand declares an alias for an object, then later the `<<: *name` -# syntax dereferences it. -# See http://blog.daemonl.com/2016/02/yaml.html -# To validate changes, use an online parser, eg. -# http://yaml-online-parser.appspot.com/ - -var_1: &docker_image cimg/node:18.17.0 -var_2: &docker-browser-image cimg/node:18.17.0-browsers - -# **Note**: When updating the beginning of the cache key, also update the cache key to match -# the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching. -# Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache. -var_3: &cache_key v16-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }} -# We want to invalidate the cache if the postinstall patches change. In order to apply new -# patches, a clean version of the node modules is needed. Additionally, we invalidate the cache -# if the Bazel version changes. We do this because otherwise the `bazelisk` cache folder will -# contain all previously used versions and ultimately cause the cache restoring to be slower. -var_4: &cache_fallback_key v16-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}- - -# Settings common to each job -var_5: &job_defaults - working_directory: ~/ng - docker: - - image: *docker_image - -# Restores the cache that could be available for the current Yarn lock file. The cache usually -# includes the node modules and the Bazel repository cache. -var_7: &restore_cache - restore_cache: - keys: - - *cache_key - - *cache_fallback_key - -# Saves the cache for the current Yarn lock file. We store the node modules and the Bazel -# repository cache in order to make subsequent builds faster. -var_8: &save_cache - save_cache: - key: *cache_key - paths: - - 'node_modules' - - '~/.cache/bazelisk' - - '~/bazel_repository_cache' - -# Decryption token that is used to decode the GCP credentials file in ".circleci/gcp_token". -var_9: &gcp_decrypt_token 'angular' - -# Job step that ensures that the node module dependencies are installed and up-to-date. We use -# Yarn with the frozen lockfile option in order to make sure that lock file and package.json are -# in sync. Unlike in Travis, we don't need to manually purge the node modules if stale because -# CircleCI automatically discards the cache if the checksum of the lock file has changed. -var_10: &yarn_install - run: - name: 'Installing project dependencies' - command: yarn install --frozen-lockfile --non-interactive - -# Installs all dependencies but does not enforce a frozen lockfile. Helpful when -# the "package.json" is updated as part of a CI job. e.g. when setting up snapshots. -var_11: &yarn_install_loose_lockfile - run: - name: 'Installing project dependencies' - command: yarn install --non-interactive - -# Sets up the Bazel config which is specific for CircleCI builds. -var_12: &setup_bazel_ci_config - run: - name: 'Setting up Bazel configuration for CI' - # Note: We add the remote config flag to the user bazelrc file that is not tracked - # by Git. This is necessary to avoid stamping builds with `.with-local-changes`. - command: echo "import %workspace%/.circleci/bazel.rc" >> ./.bazelrc.user - -# Attaches the release output which has been stored in the workspace to the current job. -# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs -var_13: &attach_release_output - attach_workspace: - at: dist/ - -# Branch filter that we can specify for jobs that should only run on publish branches. This filter -# is used to ensure that not all upstream branches will be published as Github builds -# (e.g. revert branches, feature branches) -var_14: &publish_branches_filter - branches: - only: - - main - # 6.0.x, 7.1.x, etc. - - /\d+\.\d+\.x/ - -# Branch filter that is usually applied to all jobs. Since there is no way within CircleCI to -# exclude a branch for all defined jobs, we need to manually specify the filters for each job. -# In order to reduce duplication we use a YAML anchor that just always excludes the "_presubmit" -# branch. We don't want to run Circle for the temporary "_presubmit" branch which is reserved -# for the caretaker. -var_15: &ignore_presubmit_branch_filter - branches: - ignore: - - '_presubmit' - -# Runs a script that sets up the Bazel remote execution. This will be used by jobs that run -# Bazel primarily and should benefit from remote caching and execution. -var_16: &setup_bazel_remote_execution - devinfra/setup-bazel-remote-exec: - bazelrc: ./.bazelrc.user - -# Sets up the bazel binary globally. We don't want to access bazel through Yarn and NodeJS -# because it could mean that the Bazel child process only has access to limited memory. -var_17: &setup_bazel_binary - run: - name: 'Setting up global Bazel binary' - command: ./scripts/circleci/setup_bazel_binary.sh - -# Sets up the Angular snapshot builds. -var_18: &setup_snapshot_builds - run: - name: 'Setting up Angular snapshot builds' - command: node ./scripts/circleci/setup-angular-snapshots.js main - -# Filter which ensures that jobs only run for pull requests. -var_19: &only_on_pull_requests_filter - branches: - only: - - /pull\/\d+/ - -# Anchor for a step that notifies Slack when preceding steps failed. -var_20: &slack_notify_on_failure - run: - name: 'Notifying team about job failure' - when: on_fail - command: yarn ci-notify-slack-failure - -# Branch filter that only matches the main branch. -var_21: &only_main_branch_filter - branches: - only: - - main - -# ----------------------------- -# Container version of CircleCI -# ----------------------------- version: 2.1 -# Configures CircleCI orbs for this pipeline. Orbs allow consumption of publicly shared -# CircleCI commands, jobs, configuration elements or executors. Read more about orbs here: -# https://circleci.com/docs/2.0/orb-intro/ -orbs: - # Set up the `queue` orb that allows us to queue up builds across jobs. We use it - # to make sure that snapshot builds are not deployed out of order, resulting in Git - # push conflicts. - queue: eddiewebb/queue@1.5.0 - devinfra: angular/dev-infra@1.0.8 - -commands: - checkout_and_rebase: - description: Checkout and rebase the repository - steps: - - checkout - # After checkout, rebase on top of target branch. - - devinfra/rebase-pr-on-target-branch: - base_revision: << pipeline.git.base_revision >> - head_revision: << pipeline.git.revision >> - -# ----------------------------------------------------------------------------------------- -# Job definitions. Jobs which are defined just here, will not run automatically. Each job -# must be part of a workflow definition in order to run for PRs and push builds. -# ----------------------------------------------------------------------------------------- jobs: - # ----------------------------------- - # Job to test that everything builds with Bazel - # ----------------------------------- - bazel_build: - <<: *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 - - *yarn_install - - *setup_bazel_binary - - # Exclude release and docs packages here as those will be built within - # the "build_release_packages" and "publish_snapshots" jobs. - - run: bazel build --build_tag_filters=-docs-package,-release-package -- src/... - - *slack_notify_on_failure - - # ------------------------------------------------------------------------------------------- - # Job that builds all release packages. The built packages can be then used in the same - # workflow to publish snapshot builds. - # ------------------------------------------------------------------------------------------- - build_release_packages: - <<: *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 - - *yarn_install - - *setup_bazel_binary - - - run: yarn build-and-check-release-output - - run: yarn check-tooling-setup - - # TODO(devversion): replace this with bazel tests that run Madge. This is - # cumbersome and doesn't guarantee no circular deps for other entry-points. - - run: yarn madge --circular dist/releases/cdk/schematics/index.js - - # Store the release output in the workspace storage. This means that other jobs - # in the same workflow can attach the release output to their job. - - persist_to_workspace: - root: dist - paths: - - 'releases/**/*' - - *slack_notify_on_failure - - upload_release_packages: - <<: *job_defaults - steps: - - checkout_and_rebase - - *restore_cache - - *attach_release_output - - *yarn_install - - # Creates package archives and passes in an appropriate meaningful archive suffix. The - # suffix consists of the pull request number and a short SHA describing the current `HEAD`. - - run: ./scripts/create-package-archives.js --suffix "pr$CIRCLE_PR_NUMBER-$(git rev-parse --short HEAD)" - # Upload archives to the CircleCI job artifacts. - - store_artifacts: - path: dist/release-archives - - # ---------------------------------------- - # Job that publishes the docs site - # ---------------------------------------- - deploy_docs_site: - docker: - - image: *docker-browser-image - resource_class: xlarge - environment: - GCP_DECRYPT_TOKEN: *gcp_decrypt_token - steps: - - checkout_and_rebase - - *restore_cache - - *setup_bazel_ci_config - - *setup_bazel_remote_execution - - *yarn_install - - *setup_bazel_binary - - - 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: + pass: docker: - - image: *docker-browser-image - resource_class: xlarge + - image: cimg/base:2022.05 steps: - - checkout_and_rebase - - *restore_cache - - *yarn_install - - - run: yarn ci-docs-monitor-test - - *slack_notify_on_failure - - # ---------------------------------------- - # Job that publishes the build snapshots - # ---------------------------------------- - publish_snapshots: - <<: *job_defaults - resource_class: xlarge - environment: - GCP_DECRYPT_TOKEN: *gcp_decrypt_token - steps: - - checkout_and_rebase - - *restore_cache - - *attach_release_output - - *setup_bazel_ci_config - - *setup_bazel_remote_execution - - *yarn_install - - *setup_bazel_binary - - # CircleCI has a config setting to enforce SSH for all github connections. - # This is not compatible with our mechanism of using a Personal Access Token - # to publish the build snapshots. In order to fix this, we unset the global option. - - run: git config --global --unset "url.ssh://git@github.com.insteadof" - - # The components examples package is not a release package, but we publish it - # as part of this job to the docs-content repository. It's not contained in the - # attached release output, so we need to build it here. - - run: yarn build-docs-content - - # Ensures that we do not push the snapshot artifacts upstream until all previous - # snapshot build jobs have completed. This helps avoiding conflicts when multiple - # commits have been pushed (resulting in multiple concurrent snapshot publish jobs). - # We increase the confidence threshold so that it queries the CircleCI API a second time - # after a delay. We do this as the CircleCI API does not refresh immediately when a job - # completes/starts, and this will improve stability of the queue step. See source: - # https://github.com/eddiewebb/circleci-queue/commit/5d42add5bbcff5e8ac7fe189448a61fea98b0839. - - queue/until_front_of_line: - confidence: '2' - - - run: ./scripts/circleci/publish-snapshots.sh - - *slack_notify_on_failure + - run: echo "This too shall pass (always)" - # ---------------------------------------------------------------------------- - # 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. -# -# NOTE: When updating this configuration section, make sure to update GitHub robot -# config to match the new workflow jobs. -# ---------------------------------------------------------------------------------------- workflows: version: 2 - default_workflow: jobs: - - bazel_build: - filters: *ignore_presubmit_branch_filter - - build_release_packages: - filters: *ignore_presubmit_branch_filter - - upload_release_packages: - # We don't want to run this job on push builds because for those, the - # `publish_snapshots` runs, and publishes build artifacts. - filters: *only_on_pull_requests_filter - requires: - - build_release_packages - - publish_snapshots: - filters: *publish_branches_filter - requires: - - build_release_packages - - deploy_docs_site: - 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 + - pass diff --git a/.github/actions/slack/action.yml b/.github/actions/slack/action.yml new file mode 100644 index 000000000000..404bce59a8a8 --- /dev/null +++ b/.github/actions/slack/action.yml @@ -0,0 +1,20 @@ +name: 'Notify slack on failure' +description: 'Notifying Slack of failure' + +inputs: + JOB_NAME: + description: 'Name of the job' + required: true + SLACK_BOT_TOKEN: + required: true + +runs: + using: 'composite' + steps: + - name: Notify about failed test + uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + with: + channel-id: 'C015EBF2XB6' + slack-message: '${{ inputs.JOB_NAME }} 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: ${{ inputs.SLACK_BOT_TOKEN }} diff --git a/.github/angular-robot.yml b/.github/angular-robot.yml index 0d635d57b447..1987139fe751 100644 --- a/.github/angular-robot.yml +++ b/.github/angular-robot.yml @@ -52,11 +52,6 @@ merge: - 'pr: needs*' - 'presubmit failures' - # list of PR statuses that need to be successful - requiredStatuses: - - 'ci/circleci: bazel_build' - - 'ci/circleci: build_release_packages' - # the comment that will be added when the merge label is added despite failing checks, leave empty or set to false to disable # {{MERGE_LABEL}} will be replaced by the value of the mergeLabel option # {{PLACEHOLDER}} will be replaced by the list of failing checks diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcd40de5cdef..70e932d59082 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,13 +56,10 @@ jobs: # it has been merged. if: github.event_name == 'pull_request' run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }} - - name: Notify about failed test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'Lint 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: + JOB_NAME: 'Lint check' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} api_golden_checks: @@ -80,13 +77,10 @@ jobs: run: yarn install --frozen-lockfile - name: Check API Goldens run: yarn bazel test tools/public_api_guard/... - - name: Notify about failed test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'API Goldens 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: + JOB_NAME: 'API Golden Checks' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} e2e: @@ -104,13 +98,10 @@ jobs: run: yarn install --frozen-lockfile - name: Run e2e tests run: yarn e2e --flaky_test_attempts=2 - - name: Notify about failed test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'E2E 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: + JOB_NAME: 'E2E test' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} integration: @@ -131,13 +122,10 @@ jobs: - name: Running size integration tests run: yarn integration-tests:size-test continue-on-error: true - - name: Notify about failed integration size-test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'Integration testing job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' - env: + JOB_NAME: 'Integration test' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} linker_aot_tests: @@ -155,13 +143,10 @@ jobs: run: yarn install --frozen-lockfile - name: Run linker AOT tests run: yarn test-linker-aot - - name: Notify about failed test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'Linker AOT 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: + JOB_NAME: 'Link AOT test' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} linker_jit_tests: @@ -179,13 +164,10 @@ jobs: run: yarn install --frozen-lockfile - name: Run linker JIT tests run: yarn test-linker-jit - - name: Notify about failed test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'Linker JIT 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: + JOB_NAME: 'Link JIT test' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} test: @@ -203,11 +185,113 @@ jobs: run: yarn install --frozen-lockfile - name: Run tests run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... - - name: Notify about failed test - if: ${{ failure() && github.event_name == 'push'}} - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} with: - channel-id: 'C015EBF2XB6' - slack-message: 'Browser test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + JOB_NAME: 'Test' + SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} + + build: + runs-on: ubuntu-latest-4core + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + with: + cache-node-modules: true + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Install node modules + run: yarn install --frozen-lockfile + - name: Run tests + run: bazel build --build_tag_filters=-docs-package,-release-package -- src/... + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'Build' + SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} + + publish_snapshots: + if: ${{ github.event_name == 'push'}} + runs-on: ubuntu-latest-4core + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + with: + cache-node-modules: true + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Install node modules + run: yarn install --frozen-lockfile + - name: Build and Verify Release Output + run: yarn build-and-check-release-output + - name: Verify tooling setup + run: yarn check-tooling-setup + - name: Build Docs Content + run: yarn build-docs-content + - name: Build Docs Content + run: yarn build-docs-content + - name: Publish Snapshots + run: ./scripts/circleci/publish-snapshots.sh env: + SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }} + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'Snapshot publishing' + SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} + + upload_package_artifacts: + if: ${{ github.event_name != 'push'}} + runs-on: ubuntu-latest-4core + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + with: + cache-node-modules: true + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Install node modules + run: yarn install --frozen-lockfile + - name: Build and Verify Release Output + run: yarn build-and-check-release-output + - name: Verify tooling setup + run: yarn check-tooling-setup + - name: Build and create package artifacts + run: ./scripts/create-package-archives.js --suffix "pr${{github.event.number}}-$(git rev-parse --short HEAD)" + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: Package Artifacts + path: dist/release-archives + + deploy_doc_site: + if: ${{ github.event_name == 'push'}} + runs-on: ubuntu-latest-4core + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + with: + cache-node-modules: true + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@9931e1a8d1b62fcd2267e89f9993a494856cc1cd + - name: Install node modules + run: yarn install --frozen-lockfile + - name: Build and Verify Release Output + run: yarn build-and-check-release-output + - name: Verify tooling setup + run: yarn check-tooling-setup + - name: Deploy the docs app + run: yarn ci-push-deploy-docs-app + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'Docs site deployment' SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} diff --git a/.github/workflows/scheduled-ci.yml b/.github/workflows/scheduled-ci.yml new file mode 100644 index 000000000000..1511336bb7e4 --- /dev/null +++ b/.github/workflows/scheduled-ci.yml @@ -0,0 +1,112 @@ +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: + browsers_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 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/... + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'Browser snapshot test' + SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }} + + linker_snapshot_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 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'Linker snapshot test' + 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/... + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'MDC Snapshot test' + 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 + - uses: ./.github/actions/slack + if: ${{ failure() && github.event_name == 'push' }} + with: + JOB_NAME: 'Docs site monitoring' + SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}