Skip to content

Commit 1ec15ee

Browse files
authored
ci: Always run code formatting CI job (even for *.md only PRs) (#10421)
This runs a separate, streamlined lint step for prettier only, if only markdown files are changed.
1 parent 34f9cc7 commit 1ec15ee

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ jobs:
165165
runs-on: ubuntu-20.04
166166
timeout-minutes: 15
167167
if: |
168-
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false') &&
169-
(needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request')
168+
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false')
170169
steps:
171170
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
172171
uses: actions/checkout@v4
@@ -215,6 +214,8 @@ jobs:
215214
needs: [job_get_metadata, job_install_deps]
216215
runs-on: ubuntu-20.04
217216
timeout-minutes: 30
217+
if: |
218+
(needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request')
218219
steps:
219220
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
220221
uses: actions/checkout@v4
@@ -319,10 +320,33 @@ jobs:
319320
env:
320321
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
321322
- name: Lint source files
322-
run: yarn lint
323+
run: yarn lint:lerna
323324
- name: Validate ES5 builds
324325
run: yarn validate:es5
325326

327+
job_check_format:
328+
name: Check file formatting
329+
needs: [job_get_metadata, job_install_deps]
330+
timeout-minutes: 10
331+
runs-on: ubuntu-20.04
332+
steps:
333+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
334+
uses: actions/checkout@v4
335+
with:
336+
ref: ${{ env.HEAD_COMMIT }}
337+
- name: Set up Node
338+
uses: actions/setup-node@v4
339+
with:
340+
node-version-file: 'package.json'
341+
- name: Check dependency cache
342+
uses: actions/cache/restore@v3
343+
with:
344+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
345+
key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}
346+
fail-on-cache-miss: true
347+
- name: Check file formatting
348+
run: yarn lint:prettier && yarn lint:biome
349+
326350
job_circular_dep_check:
327351
name: Circular Dependency Check
328352
needs: [job_get_metadata, job_build]
@@ -1015,6 +1039,7 @@ jobs:
10151039
job_e2e_tests,
10161040
job_artifacts,
10171041
job_lint,
1042+
job_check_format,
10181043
job_circular_dep_check,
10191044
]
10201045
# Always run this, even if a dependent job failed

0 commit comments

Comments
 (0)