Skip to content

Commit b99178c

Browse files
authored
fix: cross-platform build (#244)
* 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
1 parent 2bd51d6 commit b99178c

File tree

6 files changed

+326
-22
lines changed

6 files changed

+326
-22
lines changed

.github/workflows/unit-tests.yml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
steps:
1414
- name: Checkout sources
1515
uses: actions/checkout@v2
16-
16+
1717
- name: Install libusb (for Ledger)
1818
run: sudo apt update && sudo apt install pkg-config libudev-dev
19-
19+
2020
- name: Install toolchain
2121
uses: actions-rs/toolchain@v1
2222
with:
@@ -57,3 +57,84 @@ jobs:
5757

5858
- name: cargo clippy
5959
run: cargo +nightly clippy --all --all-features -- -D warnings
60+
61+
62+
build:
63+
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
64+
runs-on: ${{ matrix.job.os }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
job:
69+
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
70+
- { target: x86_64-apple-darwin , os: macos-10.15 }
71+
- { target: i686-pc-windows-msvc , os: windows-2019 }
72+
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
73+
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
74+
75+
steps:
76+
- name: Checkout source code
77+
uses: actions/checkout@v2
78+
79+
- name: Install prerequisites
80+
shell: bash
81+
run: |
82+
case ${{ matrix.job.target }} in
83+
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
84+
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
85+
esac
86+
87+
- name: Install packages (Ubuntu)
88+
if: matrix.job.os == 'ubuntu-20.04'
89+
run: |
90+
sudo apt update
91+
sudo apt install libudev-dev pkg-config
92+
93+
- name: Extract crate information
94+
shell: bash
95+
run: |
96+
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
97+
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
98+
99+
- name: Install Rust toolchain
100+
uses: actions-rs/toolchain@v1
101+
with:
102+
toolchain: stable
103+
target: ${{ matrix.job.target }}
104+
override: true
105+
profile: minimal
106+
107+
- name: Show installed version information (Rust, cargo, GCC,...)
108+
shell: bash
109+
run: |
110+
gcc --version || true
111+
rustup -V
112+
rustup toolchain list
113+
rustup default
114+
cargo -V
115+
rustc -V
116+
117+
- uses: Swatinem/rust-cache@v1
118+
with:
119+
cache-on-failure: true
120+
121+
- name: Build foundry and call crates
122+
uses: actions-rs/cargo@v1
123+
with:
124+
use-cross: ${{ matrix.job.use-cross }}
125+
command: build
126+
args: --verbose --workspace
127+
128+
- name: Run forge
129+
uses: actions-rs/cargo@v1
130+
with:
131+
use-cross: ${{ matrix.job.use-cross }}
132+
command: run
133+
args: -p foundry-cli --bin forge -- --help
134+
135+
- name: Run tests without --default-features to avoid solc-asm being used
136+
uses: actions-rs/cargo@v1
137+
with:
138+
use-cross: ${{ matrix.job.use-cross }}
139+
command: test
140+
args: --verbose --workspace

0 commit comments

Comments
 (0)