Merge remote-tracking branch 'sophon-org/main' into sophon-main #193
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Swift CI | |
| on: | |
| push: | |
| paths: | |
| - 'packages/contracts/**' | |
| - 'packages/sdk-platforms/**' | |
| jobs: | |
| swift-sdk: | |
| name: Swift Package - latest | |
| runs-on: macos-15 | |
| strategy: | |
| matrix: | |
| config: | |
| - debug | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Run sccache-cache | |
| uses: mozilla-actions/sccache-action@v0.0.4 | |
| - name: Install Rust | |
| run: | | |
| rustup update stable && rustup default stable | |
| rustup toolchain install nightly | |
| - name: Run rustfmt | |
| run: | | |
| rustup component add rustfmt --toolchain nightly | |
| cargo +nightly fmt --all -- --check | |
| working-directory: packages/sdk-platforms/rust/zksync-sso | |
| - name: Install Anvil ZKsync Manually | |
| run: | | |
| SCRIPT_PATH=".github/workflows/scripts/install-anvil-zksync.sh" | |
| chmod +x "$SCRIPT_PATH" | |
| sh "$SCRIPT_PATH" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.11.0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/Iron | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install -r --frozen-lockfile | |
| - name: Install contract dependencies | |
| run: pnpm install -r --frozen-lockfile | |
| working-directory: packages/contracts | |
| - name: Build contracts | |
| run: pnpm build | |
| working-directory: packages/contracts | |
| - name: Run clippy | |
| run: | | |
| rustup component add clippy --toolchain stable | |
| cargo clippy --all-targets -- -D warnings | |
| working-directory: packages/sdk-platforms/rust/zksync-sso | |
| - name: Run rust tests | |
| run: cargo test | |
| working-directory: packages/sdk-platforms/rust/zksync-sso | |
| - name: Start anvil-zksync node | |
| run: | | |
| anvil-zksync --cache=none run > anvil-zksync.log 2>&1 & | |
| # Wait a few seconds to ensure the node starts | |
| sleep 5 | |
| # Verify it's running | |
| if ! pgrep -f "anvil-zksync"; then | |
| echo "Error: anvil-zksync failed to start" | |
| cat anvil-zksync.log | |
| exit 1 | |
| fi | |
| - name: Deploy contracts and create Swift config | |
| run: cargo run --bin cli -- deploy-contracts | |
| working-directory: packages/sdk-platforms/rust/zksync-sso | |
| - name: Select Xcode 16.3 | |
| run: sudo xcode-select -s /Applications/Xcode_16.3.app | |
| - name: Select Simulator | |
| run: | | |
| UDID=$(xcrun simctl list devices | awk '/-- iOS 18.4 --/{flag=1; next} /--/{flag=0} flag' | grep "iPhone 16 Pro" | awk -F '[()]' '{print $2}' | head -1) | |
| if [ -z "$UDID" ]; then | |
| echo "Simulator not found!" >&2 | |
| exit 1 | |
| fi | |
| echo "Simulator UDID: $UDID" | |
| echo "SIMULATOR_UDID=$UDID" >> $GITHUB_ENV | |
| - name: Install swiftformat | |
| run: brew install swiftformat | |
| - name: Build bindings | |
| run: sh packages/sdk-platforms/rust/zksync-sso/crates/ffi/build-swift-framework-ios-ci.sh | |
| - name: Build & test Swift SDK | |
| run: | | |
| xcodebuild test \ | |
| -skipMacroValidation \ | |
| -configuration debug \ | |
| -workspace .github/package.xcworkspace \ | |
| -scheme zksyncsso \ | |
| -destination "platform=iOS Simulator,id=${{ env.SIMULATOR_UDID }}" || exit 1 |