Skip to content

Commit

Permalink
Pnpm experiment (#420)
Browse files Browse the repository at this point in the history
This PR:
- Fixes #349 
- Upgrades the certora-cli version used on Github actions to `7.3.0` 

PNPM is more strict about transitive dependencies and sometimes strange
things happen with module resolution unless the dependency is explicitly
stated in `package.json` and imported. I added comments to highlight
such cases.

@nlordell please test this change on linux :)

---------

Co-authored-by: Nicholas Rodrigues Lordello <nick@safe.global>
  • Loading branch information
mmv08 and nlordell authored May 16, 2024
1 parent 8a90660 commit 894ac3f
Show file tree
Hide file tree
Showing 37 changed files with 11,260 additions and 31,461 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/certora_4337.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Install python
uses: actions/setup-python@v4
with: { python-version: 3.11 }

- name: Install certora cli
run: pip install -Iv certora-cli==6.1.3
run: pip install -Iv certora-cli==7.3.0

- name: Install solc
run: |
Expand All @@ -37,7 +42,7 @@ jobs:
sudo mv solc-static-linux /usr/local/bin/solc8.23
- name: Install dependencies
run: npm ci
run: pnpm install

- name: Verify rule ${{ matrix.rule }}
working-directory: ./modules/4337
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
- run: npm ci
- run: npm run fmt:global-check
cache: pnpm
- run: pnpm install
- run: pnpm run fmt:global-check
28 changes: 19 additions & 9 deletions .github/workflows/ci_4337.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
pnpm install
npm run coverage -w modules/4337
- name: Coveralls
uses: coverallsapp/github-action@master
Expand All @@ -26,24 +29,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
pnpm install
npm run test:4337 -w modules/4337
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
pnpm install
npm run lint -w modules/4337
npm run fmt:check -w modules/4337
18 changes: 11 additions & 7 deletions .github/workflows/ci_4337_gas_metering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- run: |
npm ci
npm run fmt:check -w examples/4337-gas-metering
npm run lint -w examples/4337-gas-metering
npm run build -w examples/4337-gas-metering
pnpm run --filter "@safe-global/safe-modules-example-4337-gas-metering" fmt:check
pnpm run --filter "@safe-global/safe-modules-example-4337-gas-metering" lint
pnpm run --filter "@safe-global/safe-modules-example-4337-gas-metering" build
13 changes: 9 additions & 4 deletions .github/workflows/ci_4337_local_bundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run lint -w packages/4337-local-bundler
pnpm install
pnpm run --filter "@safe-global/safe-4337-local-bundler" lint
14 changes: 9 additions & 5 deletions .github/workflows/ci_4337_upstream_bundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run test:4337:upstream -w modules/4337
npm run test:4337:upstream -w modules/passkey
pnpm install
pnpm run --filter "{modules/4337}" --filter "{modules/passkey}" test:4337:upstream
48 changes: 30 additions & 18 deletions .github/workflows/ci_passkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run coverage -w modules/passkey
pnpm install
pnpm run --filter "@safe-global/safe-passkey" coverage
- uses: coverallsapp/github-action@master
with:
path-to-lcov: modules/passkey/coverage/lcov.info
Expand All @@ -25,37 +28,46 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run lint -w modules/passkey
npm run fmt:check -w modules/passkey
npm run build -w modules/passkey
pnpm install
pnpm run --filter "@safe-global/safe-passkey" lint
pnpm run --filter "@safe-global/safe-passkey" fmt:check
pnpm run --filter "@safe-global/safe-passkey" build
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run test:4337 -w modules/passkey
pnpm install
pnpm run --filter "@safe-global/safe-passkey" test:4337
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run bench -w modules/passkey
pnpm install
pnpm run --filter "@safe-global/safe-passkey" bench
13 changes: 8 additions & 5 deletions .github/workflows/ci_passkey_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
cache: pnpm
- run: |
npm ci
npm run lint -w examples/4337-passkeys
npm run build -w examples/4337-passkeys
pnpm install
pnpm run -F "{examples/4337-passkeys}" lint
pnpm run -F "{examples/4337-passkeys}" build
env:
VITE_WC_CLOUD_PROJECT_ID: ${{ secrets.VITE_WC_CLOUD_PROJECT_ID }}
VITE_WC_4337_BUNDLER_URL: ${{ secrets.VITE_WC_4337_BUNDLER_URL }}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# They're excluded on the global level because each of them defines its own linting and formatting rules
examples/**
modules/**
packages/**
pnpm-lock.yaml
Loading

0 comments on commit 894ac3f

Please sign in to comment.