diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 34f6fea..1bf3e8f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,5 +13,8 @@ "vitest.explorer" ] } + }, + "features": { + "ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5": {} } } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..641fb83 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: latest + run_install: false + + - 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: Run lint + run: pnpm run lint + + - name: Run tests with coverage + run: pnpm run test:cov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage/coverage-final.json + slug: onozaty/prisma-db-comments-generator + + - name: Build + run: pnpm run build diff --git a/README.md b/README.md index 16ae55d..faf31c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # prisma-db-comments-generator +[![Test](https://github.com/onozaty/prisma-db-comments-generator/actions/workflows/test.yml/badge.svg)](https://github.com/onozaty/prisma-db-comments-generator/actions/workflows/test.yml) +[![codecov](https://codecov.io/gh/onozaty/prisma-db-comments-generator/graph/badge.svg?token=406L0D8MI0)](https://codecov.io/gh/onozaty/prisma-db-comments-generator) +[![npm version](https://badge.fury.io/js/@onozaty%2Fprisma-db-comments-generator.svg)](https://badge.fury.io/js/@onozaty%2Fprisma-db-comments-generator) + Generate database comments from Prisma schema. It is based on the following code idea. Thank you @Jyrno42 . diff --git a/package.json b/package.json index e2f7784..ead5b23 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "build": "rm -rf dist/ && node build.js", "prepare": "pnpm run build", "format": "prettier --write src/**", - "lint": "eslint src/**", + "lint": "eslint 'src/**/*.ts' --ignore-pattern 'src/__fixtures__/**'", "test": "vitest run", "test:cov": "vitest run --coverage", "db:migrate": "prisma migrate dev && prisma generate && pnpm run db:deploy",