Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint-and-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run lint-staged
Copy link
Owner

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: npx lint-staged
Copy link
Owner

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.


- name: Run Astro check
run: npx astro check
env:
GITHUB_REPO_URL: https://github.com/WebDevSimplified/wds-shadcn-registry
DEPLOY_PRIME_URL: https://localhost:4321
URL: https://wds-shadcn-registry.netlify.app

- name: Build registry
Copy link
Owner

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.

run: npm run registry:build