Skip to content

Commit 8b4d55a

Browse files
committed
ci: simplify release-please conditionals
This changeset modifies the CI test workflows to not run on release PRs. One effect this PR will have is that these workflows will no longer report a status on release-please PRs. Because we have our repo rules configured to require these workflows' jobs to block merges to main unless these workflows are in a passing state, merging this as is will break release-please branches. To fix this, we'll modify the merge-to-main ruleset to exclude the release-please bot user from the ruleset's requirements.
1 parent d2497e3 commit 8b4d55a

File tree

9 files changed

+34
-54
lines changed

9 files changed

+34
-54
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
912
schedule:
1013
- cron: '0 0 * * 0'
1114
workflow_dispatch:

.github/workflows/e2e-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
push:
66
branches: [main]
77
pull_request:
8+
branches:
9+
- '**'
10+
- '!release-please--**'
811
schedule:
912
# check daily to notice potential package manager issues
1013
- cron: '0 1 * * *' # At 01:00 daily

.github/workflows/format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
912

1013
jobs:
1114
format:

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
912

1013
jobs:
1114
integration:
@@ -28,63 +31,47 @@ jobs:
2831
node-version: '22'
2932
fail-fast: false
3033
steps:
31-
# Sets an output parameter if this is a release PR
32-
- name: Check for release
33-
id: release-check
34-
# For windows we have to use $env:
35-
run: |-
36-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
37-
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
38-
if: "${{ startsWith(github.head_ref, 'release-') }}"
39-
4034
# This improves Windows network performance, we need this since we open many ports in our tests
4135
- name: Increase Windows port limit and reduce time wait delay
4236
run: |
4337
netsh int ipv4 set dynamicport tcp start=1025 num=64511
4438
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters /v TcpTimedWaitDelay /t REG_DWORD /d 30 /f
45-
if: "${{ matrix.os == 'windows-latest' && !steps.release-check.outputs.IS_RELEASE }}"
39+
if: "${{ matrix.os == 'windows-latest' }}"
4640

4741
- name: Git checkout
4842
uses: actions/checkout@v4
4943
with:
5044
fetch-depth: 0
51-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5245

5346
- name: Use Node.js ${{ matrix.node-version }}
5447
uses: actions/setup-node@v4
5548
with:
5649
node-version: ${{ matrix.node-version }}
5750
cache: npm
5851
check-latest: true
59-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
6052

6153
- name: Install PNPM
6254
run: |
6355
corepack enable
6456
corepack prepare [email protected] --activate
65-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
6657
6758
- name: Setup Deno
6859
uses: denoland/setup-deno@v1
69-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
7060
with:
7161
deno-version: v1.44.4
7262

7363
- name: Install core dependencies
7464
run: npm ci --no-audit
75-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
7665

7766
- name: Build project
7867
run: npm run build
7968
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
8069

8170
- name: Prepare tests
8271
run: npm run test:init
83-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
8472

8573
- name: Tests
8674
uses: nick-fields/retry@v3
87-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
8875
with:
8976
timeout_minutes: 15
9077
max_attempts: 3
@@ -113,7 +100,6 @@ jobs:
113100
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
114101
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
115102
shell: bash
116-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
117103

118104
- name: Sanitize shard for artefact name
119105
id: sanitize-shard-name
@@ -132,23 +118,13 @@ jobs:
132118
with:
133119
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
134120
token: ${{ secrets.CODECOV_TOKEN }}
135-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
136121
# Specific tests for known test that failed on windows using node 23.
137122
# Can be replaced with larger node 23 tests in the future.
138123
integration-win-node-23:
139124
name: Integration test windows latest node23 specific
140125
runs-on: windows-latest
141126
timeout-minutes: 40
142127
steps:
143-
# Sets an output parameter if this is a release PR
144-
- name: Check for release
145-
id: release-check
146-
# For windows we have to use $env:
147-
run: |-
148-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
149-
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
150-
if: "${{ startsWith(github.head_ref, 'release-') }}"
151-
152128
# This improves Windows network performance, we need this since we open many ports in our tests
153129
- name: Increase Windows port limit and reduce time wait delay
154130
run: |
@@ -159,43 +135,36 @@ jobs:
159135
uses: actions/checkout@v4
160136
with:
161137
fetch-depth: 0
162-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
163138

164139
- name: Use Node.js
165140
uses: actions/setup-node@v4
166141
with:
167142
node-version: '23.x'
168143
cache: npm
169144
check-latest: true
170-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
171145

172146
- name: Install PNPM
173147
run: |
174148
corepack enable
175149
corepack prepare [email protected] --activate
176-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
177150
178151
- name: Setup Deno
179152
uses: denoland/setup-deno@v1
180-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
181153
with:
182154
deno-version: v1.44.4
183155

184156
- name: Install core dependencies
185157
run: npm ci --no-audit
186-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
187158

188159
- name: Build project
189160
run: npm run build
190161
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
191162

192163
- name: Prepare tests
193164
run: npm run test:init
194-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
195165

196166
- name: Tests
197167
uses: nick-fields/retry@v3
198-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
199168
with:
200169
timeout_minutes: 15
201170
max_attempts: 3
@@ -224,7 +193,6 @@ jobs:
224193
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
225194
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
226195
shell: bash
227-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
228196

229197
- name: Store npm error artefacts
230198
uses: actions/upload-artifact@v4
@@ -239,4 +207,3 @@ jobs:
239207
with:
240208
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
241209
token: ${{ secrets.CODECOV_TOKEN }}
242-
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
912

1013
jobs:
1114
lint:

.github/workflows/typecheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
912

1013
jobs:
1114
typecheck:

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Unit Tests
33

44
on:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
812

913
jobs:
1014
unit:
@@ -19,34 +23,21 @@ jobs:
1923
node-version: '22.x'
2024
fail-fast: false
2125
steps:
22-
# Sets an output parameter if this is a release PR
23-
- name: Check for release
24-
id: release-check
25-
# For windows we have to use $env:
26-
run: |-
27-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
28-
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
29-
if: "${{ startsWith(github.head_ref, 'release-') }}"
30-
3126
- name: Git checkout
3227
uses: actions/checkout@v4
33-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
3428

3529
- name: Use Node.js ${{ matrix.node-version }}
3630
uses: actions/setup-node@v4
3731
with:
3832
node-version: ${{ matrix.node-version }}
3933
cache: npm
4034
check-latest: true
41-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
4235

4336
- name: Install core dependencies
4437
run: npm ci --no-audit
45-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
4638

4739
- name: Build project
4840
run: npm run build
49-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5041

5142
- name: Run unit tests
5243
uses: nick-fields/retry@v3
@@ -55,4 +46,3 @@ jobs:
5546
max_attempts: 3
5647
retry_on: error
5748
command: npm run test:ci:vitest:unit
58-
if: '${{!steps.release-check.outputs.IS_RELEASE}}'

.github/workflows/vale.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Lint Docs
33

44
on:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
812

913
permissions:
1014
checks: write

.github/workflows/verify-docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Verify Docs
33

44
on:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78
pull_request:
9+
branches:
10+
- '**'
11+
- '!release-please--**'
812

913
jobs:
1014
verify-docs:

0 commit comments

Comments
 (0)