Skip to content

Commit 3d31a11

Browse files
committed
ci: split ci into privileged and unprivileged workflows (#2078)
Split the workflows to prevent unexpected overlap between environments. PR Close #2078
1 parent 2e7bde8 commit 3d31a11

File tree

2 files changed

+79
-10
lines changed

2 files changed

+79
-10
lines changed

.github/workflows/ci.yml

-10
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
types: [opened, synchronize, reopened]
97

108
concurrency:
119
group: ${{ github.workflow }}-${{ github.ref }}
@@ -30,14 +28,6 @@ jobs:
3028
- uses: ./github-actions/bazel/setup
3129
- uses: ./github-actions/bazel/configure-remote
3230
- run: yarn install --immutable
33-
- name: Check code format
34-
if: github.event_name == 'pull_request'
35-
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
36-
- name: Check commit message
37-
if: github.event_name == 'pull_request'
38-
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
39-
- name: Check code lint
40-
run: yarn lint
4131
- name: Confirm code builds with typescript as expected
4232
run: yarn tsc -p tsconfig.json
4333

.github/workflows/pr.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions: {}
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
jobs:
18+
lint:
19+
timeout-minutes: 10
20+
runs-on: ubuntu-latest
21+
steps:
22+
# Because the checkout and setup node action is contained in the dev-infra repo, we must
23+
# checkout the repo to be able to run the action we have created. Other repos will skip
24+
# this step.
25+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
26+
- uses: ./github-actions/npm/checkout-and-setup-node
27+
- uses: ./github-actions/bazel/setup
28+
- uses: ./github-actions/bazel/configure-remote
29+
- run: yarn install --immutable
30+
- name: Check code format
31+
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
32+
- name: Check commit message
33+
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
34+
- name: Check code lint
35+
run: yarn lint
36+
- name: Confirm code builds with typescript as expected
37+
run: yarn tsc -p tsconfig.json
38+
39+
test:
40+
timeout-minutes: 15
41+
runs-on: ubuntu-latest
42+
steps:
43+
# Because the checkout and setup node action is contained in the dev-infra repo, we must
44+
# checkout the repo to be able to run the action we have created. Other repos will skip
45+
# this step.
46+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
47+
- uses: ./github-actions/npm/checkout-and-setup-node
48+
- uses: ./github-actions/bazel/setup
49+
- uses: ./github-actions/bazel/configure-remote
50+
- run: yarn install --immutable
51+
- run: yarn bazel test -- //...
52+
53+
test-win:
54+
timeout-minutes: 30
55+
runs-on: windows-latest
56+
steps:
57+
# Because the checkout and setup node action is contained in the dev-infra repo, we must
58+
# checkout the repo to be able to run the action we have created. Other repos will skip
59+
# this step.
60+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
61+
- uses: ./github-actions/npm/checkout-and-setup-node
62+
- uses: ./github-actions/bazel/setup
63+
- uses: ./github-actions/bazel/configure-remote
64+
- run: yarn install --immutable
65+
- run: yarn bazel test --test_tag_filters=windows --build_tests_only -- ... -bazel/remote-execution/...
66+
67+
test-macos:
68+
timeout-minutes: 30
69+
runs-on: macos-latest
70+
steps:
71+
# Because the checkout and setup node action is contained in the dev-infra repo, we must
72+
# checkout the repo to be able to run the action we have created. Other repos will skip
73+
# this step.
74+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
75+
- uses: ./github-actions/npm/checkout-and-setup-node
76+
- uses: ./github-actions/bazel/setup
77+
- uses: ./github-actions/bazel/configure-remote
78+
- run: yarn install --immutable
79+
- run: yarn bazel test --test_tag_filters=macos --build_tests_only -- //... -//bazel/remote-execution/...

0 commit comments

Comments
 (0)