From 6f5b372f75a2f98818702d088c4e7bb62834c4a8 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 21 Oct 2022 12:45:15 +0200 Subject: [PATCH] chore: add knip to ci (#48149) * chore: add knip to ci * DEBUG: checking things fail * refactor: split into separate workflow * fix: restrict to node 16 Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> * feat: run on schedule only * Revert "DEBUG: checking things fail" This reverts commit b8b4fe1bb275aa0f8afbe2db850dcf208aee44f7. * chore: rename file & name Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Co-authored-by: Mrugesh Mohapatra --- .github/workflows/node.js-find-unused.yml | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/node.js-find-unused.yml diff --git a/.github/workflows/node.js-find-unused.yml b/.github/workflows/node.js-find-unused.yml new file mode 100644 index 00000000000..8e22bfc63ef --- /dev/null +++ b/.github/workflows/node.js-find-unused.yml @@ -0,0 +1,41 @@ +name: CI - Unused Exports, Types and Files +env: + NODE_OPTIONS: '--max_old_space_size=6144' +on: + schedule: + # runs every monday at 08:45 UTC + - cron: '45 8 * * 1' + +permissions: + contents: read + +jobs: + lint: + name: Find Unused + runs-on: ubuntu-20.04 + + strategy: + fail-fast: false + matrix: + node-version: [16.x] + + steps: + - name: Checkout Source Files + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Set Environment variables + run: | + cp sample.env .env + cat .env + + - name: Run Checks + run: | + echo npm version $(npm -v) + npm ci + npm run knip