diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b77a91c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: ['**'] + +jobs: + ci: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Check formatting + run: pnpm format:check + + - name: Lint + run: pnpm lint + + - name: Test + run: pnpm test diff --git a/.github/workflows/deploy-check.yml b/.github/workflows/deploy-check.yml new file mode 100644 index 0000000..76eebb8 --- /dev/null +++ b/.github/workflows/deploy-check.yml @@ -0,0 +1,41 @@ +name: Deploy Check + +on: + push: + branches: [main] + +jobs: + deploy-check: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Check formatting + run: pnpm format:check + + - name: Lint + run: pnpm lint + + - name: Test + run: pnpm test + + - name: Build + run: pnpm build diff --git a/package.json b/package.json index c727cd5..2cd2e5a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "lint": "pnpm -r lint", "format": "prettier --write .", - "format:check": "prettier --check ." + "format:check": "prettier --check .", + "test": "pnpm -r test", + "build": "pnpm -r build" }, "devDependencies": { "@eslint/js": "^10.0.1",