-
-
Notifications
You must be signed in to change notification settings - Fork 30
Add GitHub actions for linting/building of registry #91
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
base: main
Are you sure you want to change the base?
Add GitHub actions for linting/building of registry #91
Conversation
|
| Name | Link |
|---|---|
| 🔨 Latest commit | 9450da8 |
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.
Sorry for taking so long to get back to you on this. I was out of town and then very busy. I left some comments on a few things that need changed/updated for this to work correctly.
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run lint-staged |
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.
Can we break each linting and formatting task into its own job? This will ensure they all run in parallel and each will throw their own errors which means if the linting and formatting is broken we will get two errors instead of only one of them running and throwing an error.
| run: npm ci | ||
|
|
||
| - name: Run lint-staged | ||
| run: npx lint-staged |
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.
This command should be broken into two different jobs npx eslint ., and npx prettier --check .. npx lint-staged only runs on staged files which there will be none in the CI environment.
| DEPLOY_PRIME_URL: https://localhost:4321 | ||
| URL: https://wds-shadcn-registry.netlify.app | ||
|
|
||
| - name: Build registry |
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.
This doesn't actually ensure the registry that is committed is the same as the one built by this command. We probably need to add a diff step to ensure the code in the registry folder doesn't change after running this since if it does change it means the registry is not being built before pushing.
Runs lint-staged, astro check, and registry build with required env vars (DEPLOY_PRIME_URL set to localhost - unsure if this is the best approach, open to feedback).
An example of the actions running can be seen in: https://github.com/LucasJantschChitolina/wds-shadcn-registry/actions/runs/17194290235/job/48774101967
closes #65