Skip to content

Commit 6b45891

Browse files
committed
ci: split ci into privileged and unprivileged workflows
Split the workflows to prevent unexpected overlap between environments.
1 parent 3be8f7e commit 6b45891

File tree

1 file changed

+10
-54
lines changed

1 file changed

+10
-54
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches:
66
- main
77
- '[0-9]+.[0-9]+.x'
8-
pull_request:
9-
types: [opened, synchronize, reopened]
108

119
concurrency:
1210
group: ${{ github.workflow }}-${{ github.ref }}
@@ -46,18 +44,8 @@ jobs:
4644
run: yarn tslint
4745
- name: Check for circular dependencies
4846
run: yarn -s ts-circular-deps:check
49-
- name: Check commit message
50-
# Commit message validation is only done on pull requests as its too late to validate once
51-
# it has been merged.
52-
if: github.event_name == 'pull_request'
53-
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
54-
- name: Check code format
55-
# Code formatting checks are only done on pull requests as its too late to validate once
56-
# it has been merged.
57-
if: github.event_name == 'pull_request'
58-
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
5947
- uses: ./.github/actions/slack
60-
if: ${{ failure() && github.event_name == 'push' }}
48+
if: failure()
6149
with:
6250
JOB_NAME: 'Lint check'
6351
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -78,7 +66,7 @@ jobs:
7866
- name: Check API Goldens
7967
run: yarn bazel test tools/public_api_guard/...
8068
- uses: ./.github/actions/slack
81-
if: ${{ failure() && github.event_name == 'push' }}
69+
if: failure()
8270
with:
8371
JOB_NAME: 'API Golden Checks'
8472
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -99,7 +87,7 @@ jobs:
9987
- name: Run e2e tests
10088
run: yarn e2e --flaky_test_attempts=2
10189
- uses: ./.github/actions/slack
102-
if: ${{ failure() && github.event_name == 'push' }}
90+
if: failure()
10391
with:
10492
JOB_NAME: 'E2E test'
10593
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -123,7 +111,7 @@ jobs:
123111
run: yarn integration-tests:size-test
124112
continue-on-error: true
125113
- uses: ./.github/actions/slack
126-
if: ${{ failure() && github.event_name == 'push' }}
114+
if: failure()
127115
with:
128116
JOB_NAME: 'Integration test'
129117
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -144,7 +132,7 @@ jobs:
144132
- name: Run linker AOT tests
145133
run: yarn test-linker-aot
146134
- uses: ./.github/actions/slack
147-
if: ${{ failure() && github.event_name == 'push' }}
135+
if: failure()
148136
with:
149137
JOB_NAME: 'Link AOT test'
150138
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -165,7 +153,7 @@ jobs:
165153
- name: Run linker JIT tests
166154
run: yarn test-linker-jit
167155
- uses: ./.github/actions/slack
168-
if: ${{ failure() && github.event_name == 'push' }}
156+
if: failure()
169157
with:
170158
JOB_NAME: 'Link JIT test'
171159
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -186,7 +174,7 @@ jobs:
186174
- name: Run tests
187175
run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
188176
- uses: ./.github/actions/slack
189-
if: ${{ failure() && github.event_name == 'push' }}
177+
if: failure()
190178
with:
191179
JOB_NAME: 'Test'
192180
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -207,13 +195,12 @@ jobs:
207195
- name: Run tests
208196
run: bazel build --build_tag_filters=-docs-package,-release-package -- src/...
209197
- uses: ./.github/actions/slack
210-
if: ${{ failure() && github.event_name == 'push' }}
198+
if: failure()
211199
with:
212200
JOB_NAME: 'Build'
213201
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
214202

215203
publish_snapshots:
216-
if: ${{ github.event_name == 'push'}}
217204
runs-on: ubuntu-latest-4core
218205
steps:
219206
- name: Initialize environment
@@ -239,39 +226,12 @@ jobs:
239226
env:
240227
SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }}
241228
- uses: ./.github/actions/slack
242-
if: ${{ failure() && github.event_name == 'push' }}
229+
if: failure()
243230
with:
244231
JOB_NAME: 'Snapshot publishing'
245232
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
246233

247-
upload_package_artifacts:
248-
if: ${{ github.event_name != 'push'}}
249-
runs-on: ubuntu-latest-4core
250-
steps:
251-
- name: Initialize environment
252-
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
253-
with:
254-
cache-node-modules: true
255-
- name: Setup Bazel
256-
uses: angular/dev-infra/github-actions/bazel/setup@804107deac3621184db54fab3e7cfe7f735a0d74
257-
- name: Setup Bazel RBE
258-
uses: angular/dev-infra/github-actions/bazel/configure-remote@804107deac3621184db54fab3e7cfe7f735a0d74
259-
- name: Install node modules
260-
run: yarn install --frozen-lockfile
261-
- name: Build and Verify Release Output
262-
run: yarn build-and-check-release-output
263-
- name: Verify tooling setup
264-
run: yarn check-tooling-setup
265-
- name: Build and create package artifacts
266-
run: ./scripts/create-package-archives.js --suffix "pr${{github.event.number}}-$(git rev-parse --short HEAD)"
267-
- name: Upload artifacts
268-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # tag=v4.3.1
269-
with:
270-
name: Package Artifacts
271-
path: dist/release-archives
272-
273234
deploy_doc_site:
274-
if: ${{ github.event_name == 'push'}}
275235
runs-on: ubuntu-latest-4core
276236
steps:
277237
- name: Initialize environment
@@ -296,7 +256,7 @@ jobs:
296256
DOCS_SITE_GCP_SERVICE_KEY: ${{ secrets.DOCS_SITE_GCP_SERVICE_KEY }}
297257
DOCS_DEPLOY_GITHUB_TOKEN: ${{ secrets.DOCS_DEPLOY_GITHUB_TOKEN }}
298258
- uses: ./.github/actions/slack
299-
if: ${{ failure() && github.event_name == 'push' }}
259+
if: failure()
300260
with:
301261
JOB_NAME: 'Docs site deployment'
302262
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
@@ -313,8 +273,6 @@ jobs:
313273
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
314274
with:
315275
cache-node-modules: true
316-
# Checking out the pull request commit is intended here as we need to run the changed code tests.
317-
ref: ${{ github.event.pull_request.head.sha }}
318276
- name: Install node modules
319277
run: yarn install --frozen-lockfile
320278
- name: Setup Bazel
@@ -335,8 +293,6 @@ jobs:
335293
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@804107deac3621184db54fab3e7cfe7f735a0d74
336294
with:
337295
cache-node-modules: true
338-
# Checking out the pull request commit is intended here as we need to run the changed code tests.
339-
ref: ${{ github.event.pull_request.head.sha }}
340296
- name: Install node modules
341297
run: yarn install --frozen-lockfile
342298
- name: Setup Bazel

0 commit comments

Comments
 (0)