From cc65a3b77940c19824e86a2a2346fc4ae44b42c9 Mon Sep 17 00:00:00 2001 From: Seedgou Date: Wed, 9 Oct 2024 15:38:31 +0800 Subject: [PATCH] ci: run `build` in github actions --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ package.json | 3 +++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bce7332 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: + - all-tools + pull_request: + branches: + - all-tools + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: ESLint Check + run: pnpm run lint-check + + - name: Format Check + run: pnpm run format-check + + - name: TypeScript Check + run: pnpm run type-check + + - name: Run build + run: pnpm run build + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist diff --git a/package.json b/package.json index 12c2e61..6a9e7c2 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "type": "module", + "packageManager": "pnpm@9.6.0", "scripts": { "dev": "vite", "build": "run-p type-check \"build-only {@}\" --", @@ -13,7 +14,9 @@ "build-only": "vite build", "type-check": "vue-tsc --build --force", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "lint-check": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", "format": "prettier --write src/", + "format-check": "prettier --check src/", "prepare": "husky" }, "dependencies": {