Skip to content

ci: Always run code formatting CI job (even for *.md only PRs) #10421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 15
if: |
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false') &&
(needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request')
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false')
steps:
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v4
Expand Down Expand Up @@ -215,6 +214,8 @@ jobs:
needs: [job_get_metadata, job_install_deps]
runs-on: ubuntu-20.04
timeout-minutes: 30
if: |
(needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request')
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -319,10 +320,33 @@ jobs:
env:
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
run: yarn lint:lerna
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this command not only lints but actually fixes issues. Do we want this here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, that's a different command (yarn fix / yarn fix:lerna)!

- name: Validate ES5 builds
run: yarn validate:es5

job_check_format:
name: Check file formatting
needs: [job_get_metadata, job_install_deps]
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Check dependency cache
uses: actions/cache/restore@v3
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}
fail-on-cache-miss: true
- name: Check file formatting
run: yarn lint:prettier && yarn lint:biome

job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
Expand Down Expand Up @@ -1015,6 +1039,7 @@ jobs:
job_e2e_tests,
job_artifacts,
job_lint,
job_check_format,
job_circular_dep_check,
]
# Always run this, even if a dependent job failed
Expand Down