Skip to content

Commit 6fd56e7

Browse files
committed
Add doc and update condition
1 parent ae648d5 commit 6fd56e7

5 files changed

Lines changed: 58 additions & 16 deletions

File tree

.github/workflows/e2e-v2.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ env:
2020
IOS_VERSION: '18.1'
2121

2222
jobs:
23-
diff_check:
24-
uses: ./.github/workflows/skip-ci.yml
25-
auth_token_check:
26-
uses: ./.github/workflows/skip-ci-noauth.yml
27-
secrets: inherit
2823
ready-to-merge-gate:
2924
name: Ready-to-merge gate
3025
uses: ./.github/workflows/ready-to-merge-workflow.yml
3126
with:
3227
is-pr: ${{ github.event_name == 'pull_request' }}
3328
labels: ${{ toJson(github.event.pull_request.labels) }}
29+
30+
diff_check:
31+
needs: [ready-to-merge-gate]
32+
uses: ./.github/workflows/skip-ci.yml
33+
auth_token_check:
34+
uses: ./.github/workflows/skip-ci-noauth.yml
35+
secrets: inherit
3436
metrics:
3537
runs-on: ${{ matrix.runs-on }}
36-
needs: [ready-to-merge-gate,diff_check, auth_token_check]
38+
needs: [diff_check, auth_token_check]
3739
if: ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.auth_token_check.outputs.skip_ci != 'true' && !startsWith(github.ref, 'refs/heads/release/') }}
3840
env:
3941
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
@@ -165,7 +167,7 @@ jobs:
165167
react-native-build:
166168
name: Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }}
167169
runs-on: ${{ matrix.runs-on }}
168-
needs: [ready-to-merge-gate,diff_check, auth_token_check]
170+
needs: [diff_check, auth_token_check]
169171
if: ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.auth_token_check.outputs.skip_ci != 'true' && !startsWith(github.ref, 'refs/heads/release/') }}
170172
env:
171173
RN_VERSION: ${{ matrix.rn-version }}
@@ -301,7 +303,7 @@ jobs:
301303
name:
302304
Test RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{
303305
matrix.build-type }} ${{ matrix.ios-use-frameworks }}
304-
needs: [ready-to-merge-gate, react-native-build, diff_check]
306+
needs: [react-native-build, diff_check]
305307
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
306308

307309
runs-on: ${{ matrix.runs-on }}

.github/workflows/native-tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@ on:
77
- v5
88
- release/**
99
pull_request:
10-
10+
types: [opened, synchronize, reopened, labeled]
11+
1112
concurrency:
1213
group: ${{ github.workflow }}-${{ github.ref }}
1314
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1415

1516
jobs:
17+
ready-to-merge-gate:
18+
name: Ready-to-merge gate
19+
uses: ./.github/workflows/ready-to-merge-workflow.yml
20+
with:
21+
is-pr: ${{ github.event_name == 'pull_request' }}
22+
labels: ${{ toJson(github.event.pull_request.labels) }}
23+
1624
diff_check:
25+
needs: [ready-to-merge-gate]
1726
uses: ./.github/workflows/skip-ci.yml
1827

1928
test-ios:

.github/workflows/sample-application-expo.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@ env:
1717
RN_SENTRY_POD_NAME: RNSentry
1818

1919
jobs:
20-
diff_check:
21-
uses: ./.github/workflows/skip-ci.yml
2220
ready-to-merge-gate:
2321
name: Ready-to-merge gate
2422
uses: ./.github/workflows/ready-to-merge-workflow.yml
2523
with:
2624
is-pr: ${{ github.event_name == 'pull_request' }}
2725
labels: ${{ toJson(github.event.pull_request.labels) }}
26+
27+
diff_check:
28+
needs: [ready-to-merge-gate]
29+
uses: ./.github/workflows/skip-ci.yml
30+
2831
build:
2932
name: Build ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks}}
3033
runs-on: ${{ matrix.runs-on }}
31-
needs: [ready-to-merge-gate, diff_check]
34+
needs: [diff_check]
3235
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
3336
env:
3437
SENTRY_DISABLE_AUTO_UPLOAD: 'true'

.github/workflows/sample-application.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,21 @@ env:
2424
ANDROID_API_LEVEL: '30'
2525

2626
jobs:
27-
diff_check:
28-
uses: ./.github/workflows/skip-ci.yml
2927
ready-to-merge-gate:
3028
name: Ready-to-merge gate
3129
uses: ./.github/workflows/ready-to-merge-workflow.yml
3230
with:
3331
is-pr: ${{ github.event_name == 'pull_request' }}
3432
labels: ${{ toJson(github.event.pull_request.labels) }}
33+
34+
diff_check:
35+
needs: [ready-to-merge-gate]
36+
uses: ./.github/workflows/skip-ci.yml
37+
3538
build:
3639
name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks}}
3740
runs-on: ${{ matrix.runs-on }}
38-
needs: [ready-to-merge-gate, diff_check]
41+
needs: [diff_check]
3942
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
4043
env:
4144
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
@@ -221,7 +224,7 @@ jobs:
221224
test:
222225
name: Test ${{ matrix.platform }} ${{ matrix.build-type }} REV2
223226
runs-on: ${{ matrix.runs-on }}
224-
needs: [ready-to-merge-gate, diff_check, build]
227+
needs: [diff_check, build]
225228
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
226229
strategy:
227230
# we want that the matrix keeps running, default is to cancel them if it fails.

CI.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CI inner working
2+
3+
## `ready-to-merge` label
4+
5+
CI checks are great, but macOS runners are limited on every provider, because of this, we need to be smarter on how we run jobs.
6+
To avoid running many jobs on every PR's commit, we have decided to only run a subset of tests regularily and run the full suite only when the PR has the label `ready-to-merge`.
7+
8+
### How to use the gate
9+
10+
Add this job at the start the workflow and then add `need: ready-to-merge-gate` to jobs that you want to be skipped.
11+
12+
```
13+
ready-to-merge-gate:
14+
name: Ready-to-merge gate
15+
uses: ./.github/workflows/ready-to-merge-workflow.yml
16+
with:
17+
is-pr: ${{ github.event_name == 'pull_request' }}
18+
labels: ${{ toJson(github.event.pull_request.labels) }}
19+
```
20+
21+
This job will:
22+
23+
- Pass if the event is not a PR
24+
- Fail if the event is a PR and is missing the `ready-to-merge` label
25+
- Pass if the event is a PR and is has the `ready-to-merge` label

0 commit comments

Comments
 (0)