Skip to content

Commit

Permalink
ci: split ci into privileged and unprivileged workflows
Browse files Browse the repository at this point in the history
Split the workflows to prevent unexpected overlap between environments.
  • Loading branch information
josephperrott committed May 20, 2024
1 parent 3be8f7e commit cad58e4
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 109 deletions.
132 changes: 44 additions & 88 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .github/workflows/deploy-dev-app-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: angular/dev-infra/github-actions/commit-message-based-labels@804107deac3621184db54fab3e7cfe7f735a0d74
- uses: angular/dev-infra/github-actions/commit-message-based-labels@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: angular/dev-infra/github-actions/post-approval-changes@804107deac3621184db54fab3e7cfe7f735a0d74
- uses: angular/dev-infra/github-actions/post-approval-changes@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/google-internal-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- uses: angular/dev-infra/github-actions/google-internal-tests@804107deac3621184db54fab3e7cfe7f735a0d74
- uses: angular/dev-infra/github-actions/google-internal-tests@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
run-tests-guide-url: http://go/angular-material-presubmit
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
233 changes: 233 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]

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

permissions: {}

defaults:
run:
shell: bash

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Checking package externals
run: |
bazel build //:package_externals
yarn check-package-externals $(bazel info bazel-bin)/package_externals.json
- name: Checking entry-points configuration
run: |
bazel build //:entry_points_manifest
yarn check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
- name: Check OWNERS file
run: yarn ownerslint
- name: Check for component id collisions
run: yarn detect-component-id-collisions
- name: Check style lint
run: yarn stylelint
- name: Check code lint
run: yarn tslint
- name: Check for circular dependencies
run: yarn -s ts-circular-deps:check
- name: Check commit message
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Check code format
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}

api_golden_checks:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Check API Goldens
run: yarn bazel test tools/public_api_guard/...

e2e:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run e2e tests
run: yarn e2e --flaky_test_attempts=2

integration:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run integration tests
run: yarn integration-tests
- name: Running size integration tests
run: yarn integration-tests:size-test
continue-on-error: true

linker_aot_tests:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run linker AOT tests
run: yarn test-linker-aot

linker_jit_tests:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run linker JIT tests
run: yarn test-linker-jit

test:
runs-on: ubuntu-latest-16core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run tests
run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...

build:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run tests
run: bazel build --build_tag_filters=-docs-package,-release-package -- src/...

upload_package_artifacts:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # tag=v4.3.1
with:
name: Package Artifacts
path: dist/release-archives

saucelabs:
runs-on: ubuntu-latest
env:
KARMA_PARALLEL_BROWSERS: 2
CI_NODE_INDEX: 0
CI_NODE_TOTAL: 1
CI_RUNNER_NUMBER: ${{ github.run_id }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
# Checking out the pull request commit is intended here as we need to run the changed code tests.
ref: ${{ github.event.pull_request.head.sha }}
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Run tests on Saucelabs
run: ./scripts/circleci/run-saucelabs-tests.sh

browserstack:
runs-on: ubuntu-latest
env:
CI_NODE_INDEX: 0
CI_NODE_TOTAL: 1
CI_RUNNER_NUMBER: ${{ github.run_id }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
# Checking out the pull request commit is intended here as we need to run the changed code tests.
ref: ${{ github.event.pull_request.head.sha }}
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/browserstack@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Run tests on Browserstack
run: ./scripts/circleci/run-browserstack-tests.sh
8 changes: 4 additions & 4 deletions .github/workflows/preview-build-dev-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ jobs:
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'dev-app preview'))
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d

# Build the web package
- run: bazel build //src/dev-app:web_package --symlink_prefix=dist/

- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@804107deac3621184db54fab3e7cfe7f735a0d74
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
workflow-artifact-name: 'dev-app'
pull-number: '${{github.event.pull_request.number}}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-deploy-dev-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
npx -y firebase-tools@latest target:clear --project ${{env.PREVIEW_PROJECT}} hosting dev-app
npx -y firebase-tools@latest target:apply --project ${{env.PREVIEW_PROJECT}} hosting dev-app ${{env.PREVIEW_SITE}}
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@804107deac3621184db54fab3e7cfe7f735a0d74
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
github-token: '${{secrets.GITHUB_TOKEN}}'
workflow-artifact-name: 'dev-app'
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/scheduled-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- 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
Expand All @@ -44,13 +44,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- 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
Expand All @@ -71,13 +71,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/setup@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/bazel/configure-remote@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
- 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
Expand All @@ -98,7 +98,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@89624a6442b75b5cda33c5e9b5c8c4f87ca4f13d
with:
cache-node-modules: true
- name: Install node modules
Expand Down

0 comments on commit cad58e4

Please sign in to comment.