From 469eff871f7520e71e029bfb3c874dfbf64e571b Mon Sep 17 00:00:00 2001 From: PP Date: Sat, 9 Sep 2023 14:55:06 +0800 Subject: [PATCH 1/3] workflow: add code quality (#2) * test eslint * update * update * test * update * update * update * Revert "test" This reverts commit 7ee93264931fcf2154d5e771057a2d7c21a82a62. --- .github/workflows/code-quality.yaml | 27 +++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/code-quality.yaml 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", From 594f111326759d3e29e2af15813cc32dde92311b Mon Sep 17 00:00:00 2001 From: PP_Pro Date: Sat, 9 Sep 2023 14:58:32 +0800 Subject: [PATCH 2/3] update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0bd3a76..fb8a214 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,5 @@ name: test -run-name: ${{ github.actor }} - test +run-name: ${{ github.actor }} - test ${{ matrix.os }} on: [pull_request] jobs: test: From 2406a119e8d371feb9ec892e375a8543a2e74414 Mon Sep 17 00:00:00 2001 From: PP_Pro Date: Sat, 9 Sep 2023 14:59:24 +0800 Subject: [PATCH 3/3] Revert "update" This reverts commit 594f111326759d3e29e2af15813cc32dde92311b. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fb8a214..0bd3a76 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,5 @@ name: test -run-name: ${{ github.actor }} - test ${{ matrix.os }} +run-name: ${{ github.actor }} - test on: [pull_request] jobs: test: