96
96
profiling_node:
97
97
- 'packages/profiling-node/**'
98
98
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
99
+ any_code:
100
+ - '!**/*.md'
99
101
100
102
101
103
- name : Get PR labels
@@ -109,6 +111,8 @@ jobs:
109
111
is_release : ${{ startsWith(github.ref, 'refs/heads/release/') }}
110
112
changed_profiling_node : ${{ steps.changed.outputs.profiling_node == 'true' }}
111
113
changed_ci : ${{ steps.changed.outputs.workflow == 'true' }}
114
+ changed_any_code : ${{ steps.changed.outputs.any_code == 'true' }}
115
+
112
116
# When merging into master, or from master
113
117
is_gitflow_sync : ${{ github.head_ref == 'master' || github.ref == 'refs/heads/master' }}
114
118
has_gitflow_label :
@@ -123,6 +127,7 @@ jobs:
123
127
runs-on : ubuntu-20.04
124
128
timeout-minutes : 15
125
129
if : |
130
+ (needs.job_get_metadata.outputs.changed_any_code) &&
126
131
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false')
127
132
steps :
128
133
- name : Check out base commit (${{ github.event.pull_request.base.sha }})
@@ -274,24 +279,37 @@ jobs:
274
279
275
280
job_check_format :
276
281
name : Check file formatting
277
- needs : [job_get_metadata, job_build ]
282
+ needs : [job_get_metadata]
278
283
timeout-minutes : 10
279
284
runs-on : ubuntu-20.04
280
285
steps :
281
286
- name : Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
282
287
uses : actions/checkout@v4
283
288
with :
284
289
ref : ${{ env.HEAD_COMMIT }}
290
+
285
291
- name : Set up Node
286
292
uses : actions/setup-node@v4
287
293
with :
288
294
node-version-file : ' package.json'
295
+
296
+ # we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed,
297
+ # so no need to reinstall them
298
+ - name : Compute dependency cache key
299
+ id : compute_lockfile_hash
300
+ run : echo "hash=${{ hashFiles('yarn.lock', '**/package.json') }}" >> "$GITHUB_OUTPUT"
301
+
289
302
- name : Check dependency cache
290
- uses : actions/cache/restore@v4
303
+ uses : actions/cache@v4
304
+ id : cache_dependencies
291
305
with :
292
306
path : ${{ env.CACHED_DEPENDENCY_PATHS }}
293
- key : ${{ needs.job_build.outputs.dependency_cache_key }}
294
- fail-on-cache-miss : true
307
+ key : ${{ steps.compute_lockfile_hash.outputs.hash }}
308
+
309
+ - name : Install dependencies
310
+ if : steps.cache_dependencies.outputs.cache-hit != 'true'
311
+ run : yarn install --ignore-engines --frozen-lockfile
312
+
295
313
- name : Check file formatting
296
314
run : yarn lint:prettier && yarn lint:biome
297
315
0 commit comments