diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..97252e9 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,38 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Prettier check + run: pnpm prettier --check . + + - name: Astro check + run: pnpm astro check + + - name: Build + run: pnpm build diff --git a/package.json b/package.json index 6c74ef1..71f56ba 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,14 @@ "build": "astro build", "preview": "astro preview", "astro": "astro", - "prepare": "husky" + "prepare": "husky", + "check": "astro check" }, "lint-staged": { - "*.{js,ts,jsx,tsx,astro,html,md,json,yml,yaml}": "prettier --write" + "*.{js,ts,jsx,tsx,astro,html,md,json,yml,yaml}": [ + "prettier --write", + "astro check --minimumSeverity warning" + ] }, "dependencies": { "@astrojs/mdx": "^4.3.6",