From 91860e4b9f046b0f313e8fecb66ef2963040d6a3 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 24 Oct 2024 16:02:21 -0400 Subject: [PATCH 1/3] implement static threshold approach --- .github/workflows/jscpd.json | 7 +++++++ .github/workflows/node.js.yml | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/jscpd.json diff --git a/.github/workflows/jscpd.json b/.github/workflows/jscpd.json new file mode 100644 index 00000000000..87dd9ce943e --- /dev/null +++ b/.github/workflows/jscpd.json @@ -0,0 +1,7 @@ +{ + "pattern": "packages/**/*.ts", + "ignore": ["**node_modules**", "**dist**"], + "gitignore": true, + "threshold": 1.34, + "minLines": 15 +} diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a4d9827b831..a4dfa047962 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -55,6 +55,26 @@ jobs: - run: npm run testCompile - run: npm run lint + jscpd: + # needs: lint-commits + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: [18.x] + env: + NODE_OPTIONS: '--max-old-space-size=8192' + steps: + - name: check out repo + uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: install jscpd + run: npm install jscpd + - name: Run jscpd + run: npx jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json" + macos: needs: lint-commits name: test macOS From 29ee61b4b600c5b2ee506d549fa67f7e697a9c2d Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 25 Oct 2024 11:19:49 -0400 Subject: [PATCH 2/3] use latest ubuntu, prereq lint --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a4dfa047962..6594e6458fc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -56,8 +56,8 @@ jobs: - run: npm run lint jscpd: - # needs: lint-commits - runs-on: ubuntu-22.04 + needs: lint-commits + runs-on: ubuntu-latest strategy: matrix: node-version: [18.x] From 5bfd5c697444435d410ad68fc665f06efb6cba8d Mon Sep 17 00:00:00 2001 From: Hweinstock <42325418+Hweinstock@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:31:12 -0400 Subject: [PATCH 3/3] Update .github/workflows/node.js.yml Co-authored-by: Justin M. Keyes --- .github/workflows/node.js.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6594e6458fc..ae255b30c76 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -64,14 +64,12 @@ jobs: env: NODE_OPTIONS: '--max-old-space-size=8192' steps: - - name: check out repo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: install jscpd - run: npm install jscpd + - run: npm install jscpd - name: Run jscpd run: npx jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"