Skip to content

Commit

Permalink
feat: Adds depcheck to CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlitvin committed Jan 10, 2022
1 parent 89eab8f commit 2b74b98
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ts-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,66 @@ jobs:
verbose: true
flags: sdk

depcheck:
name: Check for unused dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Fetch history
run: git fetch

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
# only install dependencies if there was a change in the deps
# if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install

- name: Check packages/batch-submitter
working-directory: ./packages/batch-submitter
run: npx depcheck

- name: Check packages/contracts
working-directory: ./packages/contracts
run: npx depcheck

- name: Check packages/core-utils
working-directory: ./packages/core-utils
run: npx depcheck

- name: Check packages/data-transport-layer
working-directory: ./packages/data-transport-layer
run: npx depcheck

- name: Check packages/message-relayer
working-directory: ./packages/message-relayer
run: npx depcheck

- name: Check packages/sdk
working-directory: ./packages/sdk
run: npx depcheck

- name: Check integration-tests
working-directory: ./integration-tests
run: npx depcheck

lint:
name: Linting
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ignores: [
"@openzeppelin/contracts",
"@types/mocha",
"@types/rimraf",
"@uniswap/v3-core",
"mocha",
"typescript",
]
11 changes: 11 additions & 0 deletions packages/contracts/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ignores: [
"@codechecks/client",
"@ethersproject/transactions",
"@openzeppelin/contracts",
"@openzeppelin/contracts-upgradeable",
"@typechain/ethers-v5",
"prettier-plugin-solidity",
"solhint-plugin-prettier",
"ts-generator",
"yargs",
]
4 changes: 4 additions & 0 deletions packages/sdk/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignores: [
"@eth-optimism/core-utils",
"ts-mocha",
]

0 comments on commit 2b74b98

Please sign in to comment.