Update README_FWEI.md #7
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: macOS Intel CI | |
on: | |
push: | |
branches: [ main, develop, feature/* ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
test-macos-intel: | |
name: Test on macOS Intel | |
runs-on: macos-latest | |
# Note: This runs on Intel Macs. Apple Silicon builds are handled separately | |
# to preserve existing macOS silicon-only workflow per project history | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Cache Cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: macos-intel-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
macos-intel-cargo- | |
macos-cargo- | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- name: Run clippy | |
run: cargo clippy --no-default-features -- -D warnings | |
- name: Install system dependencies | |
run: | | |
brew install openssl | |
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl | |
export OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib | |
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include | |
- name: Build (default features) | |
run: cargo build --no-default-features | |
env: | |
OPENSSL_ROOT_DIR: /usr/local/opt/openssl | |
OPENSSL_LIB_DIR: /usr/local/opt/openssl/lib | |
OPENSSL_INCLUDE_DIR: /usr/local/opt/openssl/include | |
- name: Build (with CLI UI) | |
run: cargo build --features cli-ui | |
env: | |
OPENSSL_ROOT_DIR: /usr/local/opt/openssl | |
OPENSSL_LIB_DIR: /usr/local/opt/openssl/lib | |
OPENSSL_INCLUDE_DIR: /usr/local/opt/openssl/include | |
- name: Run tests (default features) | |
run: cargo test --no-default-features --lib | |
continue-on-error: true | |
env: | |
OPENSSL_ROOT_DIR: /usr/local/opt/openssl | |
OPENSSL_LIB_DIR: /usr/local/opt/openssl/lib | |
OPENSSL_INCLUDE_DIR: /usr/local/opt/openssl/include | |
- name: Run tests (with CLI UI) | |
run: cargo test --features cli-ui --lib | |
continue-on-error: true | |
env: | |
OPENSSL_ROOT_DIR: /usr/local/opt/openssl | |
OPENSSL_LIB_DIR: /usr/local/opt/openssl/lib | |
OPENSSL_INCLUDE_DIR: /usr/local/opt/openssl/include | |
- name: Build release binary | |
run: cargo build --release --no-default-features | |
env: | |
OPENSSL_ROOT_DIR: /usr/local/opt/openssl | |
OPENSSL_LIB_DIR: /usr/local/opt/openssl/lib | |
OPENSSL_INCLUDE_DIR: /usr/local/opt/openssl/include | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: codl3-zksync-macos-intel | |
path: target/release/codl3-zksync | |
if-no-files-found: warn | |
macos-cross-compile: | |
name: Cross-compile for macOS (from Linux) | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
targets: x86_64-apple-darwin | |
- name: Install osxcross | |
run: | | |
git clone https://github.com/tpoechtrager/osxcross | |
cd osxcross | |
wget -nc https://s3.dockerproject.org/darwin/v2/MacOSX10.11.sdk.tar.xz | |
mv MacOSX10.11.sdk.tar.xz tarballs/ | |
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh | |
export PATH="$PWD/target/bin:$PATH" | |
echo "PATH=$PWD/target/bin:$PATH" >> $GITHUB_ENV | |
- name: Build for macOS Intel | |
run: | | |
export PATH="/home/runner/work/osxcross/target/bin:$PATH" | |
cargo build --release --no-default-features --target x86_64-apple-darwin | |
- name: Upload macOS cross-compiled binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: codl3-zksync-macos-intel-cross | |
path: target/x86_64-apple-darwin/release/codl3-zksync | |
if-no-files-found: warn |