-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/forking
- Loading branch information
Showing
132 changed files
with
242 additions
and
512 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,205 +1,54 @@ | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
name: cross-platform | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
on: push | ||
name: foxar pipeline | ||
jobs: | ||
build-tests: | ||
name: building ${{ matrix.job.target }} (${{ matrix.job.os }}) / ${{ matrix.archive.name }} | ||
runs-on: ${{ matrix.job.os }} | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
archive: | ||
- name: unit-tests | ||
file: nextest-unit.tar.zst | ||
flags: --workspace --all-features --lib --bins | ||
- name: integration-tests | ||
file: nextest-integration.tar.zst | ||
flags: --workspace | ||
job: | ||
# The OS is used for the runner | ||
# The target is used by Cargo | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.job.target }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
|
||
# Required for spark commands that use git | ||
- name: Setup git | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "<>" | ||
- name: Apple M1 setup | ||
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }} | ||
run: | | ||
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV | ||
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV | ||
- name: Linux ARM setup | ||
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y gcc-aarch64-linux-gnu | ||
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | ||
# For some reason the FFI cheatcode uses WSL bash instead of Git bash, so we need to install a WSL distribution | ||
- name: Windows setup | ||
if: ${{ matrix.job.target == 'x86_64-pc-windows-msvc' }} | ||
uses: Vampire/setup-wsl@v1 | ||
with: | ||
distribution: Ubuntu-20.04 | ||
set-as-default: true | ||
|
||
- name: Build archive (unit tests) | ||
run: | | ||
cargo nextest archive \ | ||
--locked ${{ matrix.job.flags }} \ | ||
--archive-file ${{ matrix.job.target }}-${{ matrix.archive.file }} | ||
- name: Upload archive | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.job.target }}-${{ matrix.archive.name }} | ||
path: ${{ matrix.job.target }}-${{ matrix.archive.file }} | ||
|
||
unit: | ||
name: unit tests ${{ matrix.job.target }} (${{ matrix.job.os }}) / ${{ matrix.archive.name }} / ${{ matrix.nextest.name }} | ||
runs-on: ${{ matrix.job.os }} | ||
needs: build-tests | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
archive: | ||
- name: unit-tests | ||
file: nextest-unit.tar.zst | ||
job: | ||
# The OS is used for the runner | ||
# The target is used by Cargo | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
nextest: | ||
- name: non-forking | ||
filter: "!test(~fork) & !test(~live) & !test(~spark_std) & !test(~deploy_and_simulate)" | ||
env: | ||
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.job.target }} | ||
- uses: taiki-e/install-action@nextest | ||
- name: Download archives | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ matrix.job.target }}-${{ matrix.archive.name }} | ||
- name: Setup git config | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "<>" | ||
- name: cargo nextest | ||
shell: bash | ||
run: | | ||
# see https://github.com/foxar-rs/foxar/pull/3959 | ||
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib" | ||
cargo nextest run --retries 3 --archive-file ${{ matrix.job.target }}-${{ matrix.archive.file }} -E '${{ matrix.nextest.filter }}' | ||
integration: | ||
name: | ||
integration tests ${{ matrix.job.target }} (${{ matrix.job.os }}) / ${{ | ||
matrix.archive.name }} / ${{ matrix.nextest.name }} | ||
runs-on: ${{ matrix.job.os }} | ||
timeout-minutes: 60 | ||
needs: build-tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
archive: | ||
- name: integration-tests | ||
file: nextest-integration.tar.zst | ||
job: | ||
# The OS is used for the runner | ||
# The target is used by Cargo | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
nextest: | ||
- name: non-forking | ||
# skip fork,verify,forge-std and script tests that use heavy simulation | ||
filter: "!test(~fork) & !test(~live) & !test(~spark_std) & !test(~deploy_and_simulate)" | ||
# the aarch64-apple-darwin runner is particularly slow with script related tests | ||
macos-aarch-filter: "!test(~fork) & !test(~live) & !test(~spark_std) & !test(~deploy_)" | ||
env: | ||
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@nextest | ||
- name: Download archives | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ matrix.job.target }}-${{ matrix.archive.name }} | ||
|
||
- name: Forge RPC cache | ||
uses: actions/cache@v3 | ||
if: matrix.nextest.name != 'non-forking' | ||
with: | ||
path: "$HOME/.foxar/cache" | ||
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }} | ||
- name: Setup git config | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "<>" | ||
- name: cargo nextest | ||
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }} | ||
shell: bash | ||
run: | | ||
# see https://github.com/foxar-rs/foxar/pull/3959 | ||
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib" | ||
cargo nextest run --retries 3 --archive-file ${{ matrix.job.target }}-${{ matrix.archive.file }} -E '${{ matrix.nextest.macos-aarch-filter }}' | ||
- name: cargo nextest | ||
if: ${{ matrix.job.target != 'aarch64-apple-darwin' }} | ||
shell: bash | ||
run: | | ||
# see https://github.com/foxar-rs/foxar/pull/3959 | ||
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib" | ||
cargo nextest run --retries 3 --archive-file ${{ matrix.job.target }}-${{ matrix.archive.file }} -E '${{ matrix.nextest.filter }}' | ||
tests: | ||
name: build ${{ matrix.job.target }} (${{ matrix.job.os }}) | ||
runs-on: ${{ matrix.job.os }} | ||
strategy: | ||
matrix: | ||
job: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.job.target }} | ||
- name: Git | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "<>" | ||
- name: Apple M1 setup | ||
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }} | ||
run: | | ||
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV | ||
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV | ||
- name: Linux ARM setup | ||
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y gcc-aarch64-linux-gnu | ||
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | ||
# For some reason the FFI cheatcode uses WSL bash instead of Git bash, so we need to install a WSL distribution | ||
- name: Windows setup | ||
if: ${{ matrix.job.target == 'x86_64-pc-windows-msvc' }} | ||
uses: Vampire/setup-wsl@v1 | ||
with: | ||
distribution: Ubuntu-20.04 | ||
set-as-default: true | ||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Test | ||
run: cargo test --all --all-features | ||
- name: Build | ||
run: cargo build |
This file contains 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
Oops, something went wrong.