Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's reasonable to assume that all of the packages within packages will be npm/yarn based (we're putting Go packages in the go directory). In that case, is it possible to loop over each directory within a GitHub action instead of listing every directory explicitly? I haven't worked with GitHub actions enough to know offhand. That way this script would work automatically for new packages and we wouldn't have to remember to add the packages to this list of directories.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah I'm not finding a clean way to do this. There's the option to use a matrix, but I don't think it's possible to feed in a dynamic value there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave myself a reminder to add this to a doc that explains what needs to be modified when adding a new package.

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: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a separate issue for reviewing these dependencies and making sure that they all belong in this ignore list.

"@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",
]