diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml new file mode 100644 index 0000000..00a87da --- /dev/null +++ b/.github/workflows/code-quality.yaml @@ -0,0 +1,27 @@ +name: code-quality +run-name: ${{ github.actor }} - code-quality +on: [pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.17.0' + + - name: Build all modules + run: npm ci + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v39 + with: + files: '**/*.ts' + + - name: Lint all changed files + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo "linting file: $file" + npx eslint $file + done diff --git a/package.json b/package.json index 3722cf1..2a6125a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "./lib/index.js", "types": "./lib/index.d.ts", "scripts": { + "postinstall": "npm run build", "build": "tsc && turbo build", "change": "node ./scripts/remove-workspaces.js && changeset add && node ./scripts/restore-workspaces.js", "version": "node ./scripts/remove-workspaces.js && changeset version && node ./scripts/restore-workspaces.js",