Skip to content

Commit

Permalink
fix: cross-platform build (#244)
Browse files Browse the repository at this point in the history
* fix(cli): default to rustls for ssl

* ci: add more workflows

* windows builds w/o default features

* fix: ensure build works w/o default features

* chore: fmt

* fix: try using platform dependent sha2/asm activation

* Revert "fix: try using platform dependent sha2/asm activation"

This reverts commit f589c08.

The target architecture configs seem to not be respected by Cargo.

* chore: default to not using sha2-asm

* fix: skip FFI Test on non-Unix systems

* ci: add caching

* ci: remove ssl installation

* chore: bump ethers to fix paths bug

gakonst/ethers-rs#712

* chore: bump ethers to fix remappings non-determinism bug

gakonst/ethers-rs#713
  • Loading branch information
gakonst authored Dec 19, 2021
1 parent 2bd51d6 commit b99178c
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 22 deletions.
85 changes: 83 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install libusb (for Ledger)
run: sudo apt update && sudo apt install pkg-config libudev-dev

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -57,3 +57,84 @@ jobs:

- name: cargo clippy
run: cargo +nightly clippy --all --all-features -- -D warnings


build:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
- { target: x86_64-apple-darwin , os: macos-10.15 }
- { target: i686-pc-windows-msvc , os: windows-2019 }
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
- { target: x86_64-pc-windows-msvc , os: windows-2019 }

steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Install prerequisites
shell: bash
run: |
case ${{ matrix.job.target }} in
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Install packages (Ubuntu)
if: matrix.job.os == 'ubuntu-20.04'
run: |
sudo apt update
sudo apt install libudev-dev pkg-config
- name: Extract crate information
shell: bash
run: |
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.job.target }}
override: true
profile: minimal

- name: Show installed version information (Rust, cargo, GCC,...)
shell: bash
run: |
gcc --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: Build foundry and call crates
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --verbose --workspace

- name: Run forge
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: run
args: -p foundry-cli --bin forge -- --help

- name: Run tests without --default-features to avoid solc-asm being used
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: test
args: --verbose --workspace
Loading

0 comments on commit b99178c

Please sign in to comment.