diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec0c3e7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + types: [opened, synchronize] + +jobs: + build: + name: Build and Test + timeout-minutes: 15 + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Check Format/Linting + run: pnpm run check:ci + + - name: Build + run: pnpm run build + + - name: Test + run: pnpm test + + - name: Check size + run: pnpm run size \ No newline at end of file diff --git a/package.json b/package.json index d6768d2..2a375c1 100644 --- a/package.json +++ b/package.json @@ -39,13 +39,12 @@ "scripts": { "build": "tsc --project tsconfig.build.json", "check": "biome check ./", + "check:ci": "biome ci ./", "format": "biome format --write ./", "prepublishOnly": "pnpm run build", "size": "size-limit", "size:why": "size-limit --why", - "test": "pnpm run test:biome && pnpm run test:vitest run", - "test:biome": "biome ci ./", - "test:vitest": "vitest" + "test": "vitest" }, "dependencies": { "clsx": "^2.1.0"