-
Notifications
You must be signed in to change notification settings - Fork 4
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
USWDS-Next - CI: Create a GH action to test code formatting #32
Changes from 1 commit
39d1346
ef95346
6342c0d
2ee8c6e
188e87c
6132bae
a9f24f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Code formatting | ||
on: push | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run prettier | ||
run: 'npm run prettier:js' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (non-blocking): Doesn't have to be in this PR but it might be a good idea to add a minimal prettier config even if we're just using defaults. Some editors need a config in order to run prettier, and it's just helpful to have at the project root to signal intent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with clear intent. Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: At some point we may need to move tasks around between actions to cut down on the number of times we're running
npm ci
in CIThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great thought.
The
setup-node
action supports caching. Added in ef95346.You should now see a
caches
link in actions.Not seeing any major differences so far.
https://github.com/uswds/uswds-next/actions/caches
Tip
Monorepo dependencies can be cached too. Example below.
Monorepo dependency cache
Details
Source: https://github.com/actions/setup-node?tab=readme-ov-file#caching-global-packages-data