@@ -87,27 +87,110 @@ jobs:
8787 run : forge build
8888 working-directory : packages/erc4337-contracts
8989
90- - name : Verify ERC-4337 contract ABIs exist
90+ - name : Run clippy
91+ run : |
92+ rustup component add clippy --toolchain stable
93+ rustup component add --toolchain 1.91.0-x86_64-unknown-linux-gnu clippy
94+ cargo clippy --all-targets -- -D warnings
95+ working-directory : packages/sdk-platforms/rust/zksync-sso-erc4337
96+
97+ - name : Install cargo-nextest
98+ uses : taiki-e/install-action@nextest
99+
100+ - name : Run rust tests with nextest
101+ run : cargo nextest run --profile ci --all-features
102+ working-directory : packages/sdk-platforms/rust/zksync-sso-erc4337
103+
104+ rust-sdk-erc4337-zksync-os :
105+ name : Rust 4337 SDK (zksync-os)
106+ runs-on : ubuntu-latest
107+ strategy :
108+ matrix :
109+ config :
110+ - debug
111+ steps :
112+ - uses : actions/checkout@v4
113+ with :
114+ submodules : recursive
115+
116+ - name : Run sccache-cache
117+ uses : mozilla-actions/sccache-action@v0.0.4
118+
119+ - name : Install Rust
120+ run : |
121+ rustup update stable && rustup default stable
122+ rustup toolchain install nightly
123+
124+ - name : Run rustfmt
125+ run : |
126+ rustup component add rustfmt --toolchain nightly
127+ cargo +nightly fmt --all -- --check
128+ working-directory : packages/sdk-platforms/rust/zksync-sso-erc4337
129+
130+ - name : Install Foundry
131+ uses : foundry-rs/foundry-toolchain@v1.4.0
132+ with :
133+ # zksync-os-server's zkos-l1-state.json doesn't work on latest version of anvil
134+ version : v1.5.1
135+
136+ - name : Install dependencies
137+ run : forge soldeer install
138+ working-directory : packages/erc4337-contracts
139+
140+ - name : Install Node.js 22 via nvm
141+ run : |
142+ export NVM_DIR="$HOME/.nvm"
143+ mkdir -p "$NVM_DIR"
144+ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
145+ . "$NVM_DIR/nvm.sh"
146+ nvm install 22
147+ nvm use 22
148+ node -v
149+ npm install -g yarn
150+ # Expose Node.js bin dir to subsequent steps
151+ echo "$(dirname $(nvm which 22))" >> $GITHUB_PATH
152+
153+ - name : Configure pnpm store dir
154+ run : echo "PNPM_STORE_DIR=$HOME/.pnpm-store" >> $GITHUB_ENV
155+
156+ - name : Cache pnpm store
157+ uses : actions/cache@v4
158+ with :
159+ path : ~/.pnpm-store
160+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('packages/erc4337-contracts/pnpm-lock.yaml') }}
161+ restore-keys : |
162+ ${{ runner.os }}-pnpm-store-
163+
164+ - name : Enable corepack and activate pnpm from contracts package.json
165+ run : |
166+ corepack enable
167+ corepack prepare "$(node -p "require('./package.json').packageManager")" --activate
168+ pnpm -v
169+ working-directory : packages/erc4337-contracts
170+
171+ - name : Install dependencies
172+ run : pnpm install --frozen-lockfile
173+ working-directory : packages/erc4337-contracts
174+
175+ - name : Build ERC-4337 contracts
176+ run : forge build
177+ working-directory : packages/erc4337-contracts
178+
179+ - name : Clone zksync-os dependencies
91180 run : |
92181 set -euo pipefail
93- missing=()
94- files=(
95- "out/IERC7579Account.sol/IERC7579Account.json"
96- "out/EntryPoint.sol/EntryPoint.json"
97- )
98- for f in "${files[@]}"; do
99- if [ ! -f "$f" ]; then
100- missing+=("$f")
101- fi
102- done
103- if [ ${#missing[@]} -gt 0 ]; then
104- echo "Missing expected ABI JSON files:" >&2
105- for m in "${missing[@]}"; do echo " - $m" >&2; done
106- echo "\nAvailable JSON files under out/:" >&2
107- find out -maxdepth 2 -type f -name '*.json' | sort || true
108- exit 1
182+ cd packages/sdk-platforms/rust/zksync-sso-erc4337
183+ if [ ! -d account-abstraction ]; then
184+ git clone https://github.com/eth-infinitism/account-abstraction
109185 fi
110- working-directory : packages/erc4337-contracts
186+ if [ ! -d zksync-os-server ]; then
187+ git clone https://github.com/matter-labs/zksync-os-server
188+ fi
189+
190+ - name : Build zksync-os-server
191+ run : |
192+ cd packages/sdk-platforms/rust/zksync-sso-erc4337/zksync-os-server
193+ cargo build --release --bin zksync-os-server
111194
112195 - name : Run clippy
113196 run : |
@@ -119,7 +202,9 @@ jobs:
119202 - name : Install cargo-nextest
120203 uses : taiki-e/install-action@nextest
121204
122- - name : Run rust tests with nextest
205+ - name : Run rust tests with nextest (zksync-os)
206+ env :
207+ SSO_TEST_NODE_BACKEND : zksyncos
123208 run : cargo nextest run --profile ci --all-features
124209 working-directory : packages/sdk-platforms/rust/zksync-sso-erc4337
125210
@@ -153,28 +238,6 @@ jobs:
153238 run : forge build
154239 working-directory : packages/erc4337-contracts
155240
156- - name : Verify ERC-4337 contract ABIs exist
157- run : |
158- set -euo pipefail
159- missing=()
160- files=(
161- "out/IERC7579Account.sol/IERC7579Account.json"
162- "out/EntryPoint.sol/EntryPoint.json"
163- )
164- for f in "${files[@]}"; do
165- if [ ! -f "$f" ]; then
166- missing+=("$f")
167- fi
168- done
169- if [ ${#missing[@]} -gt 0 ]; then
170- echo "Missing expected ABI JSON files:" >&2
171- for m in "${missing[@]}"; do echo " - $m" >&2; done
172- echo "\nAvailable JSON files under out/:" >&2
173- find out -maxdepth 2 -type f -name '*.json' | sort || true
174- exit 1
175- fi
176- working-directory : packages/erc4337-contracts
177-
178241 - name : Build WASM module (web target)
179242 run : wasm-pack build --target web
180243 working-directory : packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-ffi-web
0 commit comments