Skip to content
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

chore: add initial cli tests #604

Merged
merged 4 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
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
33 changes: 32 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,35 @@ jobs:
- name: Install dependencies
run: pnpm install

- run: pnpm lint
- run: pnpm lint

cli-test:
name: CLI-Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18

# PNPM Store cache setup
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm -F shadcn-svelte test
7 changes: 5 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta",
"pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next",
"pub:release": "pnpm build && pnpm publish --access public",
"temp": "pnpm build && pnpm start config"
"temp": "pnpm build && pnpm start config",
"test": "vitest"
},
"dependencies": {
"chalk": "5.2.0",
Expand All @@ -63,6 +64,7 @@
"@ianvs/prettier-plugin-sort-imports": "^3.7.2",
"@types/estree": "^1.0.1",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.17.5",
"@types/prettier": "^2.7.2",
"@types/prompts": "^2.4.2",
"acorn": "^8.8.2",
Expand All @@ -74,6 +76,7 @@
"rimraf": "^4.1.3",
"tsup": "^6.6.3",
"type-fest": "^3.8.0",
"typescript": "^4.9.3"
"typescript": "^4.9.3",
"vitest": "^0.34.1"
}
}
Loading