Skip to content

chore(ci): unit test workflow #1

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 2 commits into from
Sep 22, 2023
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
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: write
pull-requests: write
packages: write

# Automatically cancel in-progress actions on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- if: ${{ steps.cache-node.outputs.cache-hit != 'true' }}
run: pnpm install
- run: pnpm run test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"build": "turbo run build --no-daemon",
"dev": "turbo run dev --no-daemon",
"lint": "turbo run lint --no-daemon",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"test": "turbo run test --filter='./packages/*' --no-daemon"
},
"devDependencies": {
"eslint": "^8.48.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"build": "tsup src/index.ts --format cjs,esm --dts",
"watch": "pnpm run build --watch",
"dev": "pnpm run build --watch",
"test": "vitest"
"test": "vitest run",
"test:watch": "vitest",
"coverage": "vitest run --coverage"
},
"devDependencies": {
"eslint": "^8.0.0",
Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"outputs": ["dist/**"]
},
"lint": {},
"test": {},
"dev": {
"cache": false,
"persistent": true
Expand Down