From d108e5c17e2ed1fb36e44b070030e0bceaf7771a Mon Sep 17 00:00:00 2001 From: Gleb Date: Thu, 27 Mar 2025 19:08:38 -0700 Subject: [PATCH 1/4] Enable multiplatform ledger tests --- .github/workflows/ledger-emulator.yml | 64 ++++++++++++++++++--------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ledger-emulator.yml b/.github/workflows/ledger-emulator.yml index ec32b861d2..7c22174ebe 100644 --- a/.github/workflows/ledger-emulator.yml +++ b/.github/workflows/ledger-emulator.yml @@ -1,31 +1,51 @@ name: Ledger Emulator Tests on: - push: - branches: [main, release/**] - pull_request: + push: + branches: [ main, release/** ] + pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }} + cancel-in-progress: true defaults: - run: - shell: bash + run: + shell: bash jobs: - emulator-tests: - runs-on: ubuntu-latest - env: - CI_TESTS: true - steps: - - uses: actions/checkout@v4 - - uses: stellar/actions/rust-cache@main - - name: install libudev-dev & libdbus-1-dev - run: | - sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev - - run: | - cargo test --manifest-path cmd/crates/stellar-ledger/Cargo.toml --features "emulator-tests" -- --nocapture - - run: cargo build --features emulator-tests - - run: | - cargo test --features emulator-tests --package soroban-test --test it -- emulator + emulator-tests: + strategy: + fail-fast: false + matrix: + sys: + # x64 + - ubuntu-latest-16-cores + # ARM + - ubuntu-jammy-16-cores-arm64 + # Intel + - macos-13 + # exclude: + # # Only run Linux x64 tests on pull request to save some time + # - sys: ${{ github.event_name != 'push' && 'ubuntu-jammy-16-cores-arm64' }} + # - sys: ${{ github.event_name != 'push' && 'macos-13' }} + runs-on: ${{ matrix.sys }} + env: + CI_TESTS: true + steps: + - uses: actions/checkout@v4 + - uses: stellar/actions/rust-cache@main + - name: Setup Colima and Docker (macOS only) + if: runner.os == 'macos' + run: | + brew install docker + brew install colima + colima start + - name: install optional dependencies (Linux only) + run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev + if: runner.os == 'Linux' + - run: > + cargo test --manifest-path cmd/crates/stellar-ledger/Cargo.toml + --features "emulator-tests" -- --nocapture + - run: cargo build --features emulator-tests + - run: cargo test --features emulator-tests --package soroban-test --test it -- emulator From 8a035126c1c42b55427bf0409d76af2fe456e146 Mon Sep 17 00:00:00 2001 From: Gleb Date: Thu, 27 Mar 2025 19:40:11 -0700 Subject: [PATCH 2/4] Add backtrace --- .github/workflows/ledger-emulator.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ledger-emulator.yml b/.github/workflows/ledger-emulator.yml index 7c22174ebe..3618b80420 100644 --- a/.github/workflows/ledger-emulator.yml +++ b/.github/workflows/ledger-emulator.yml @@ -44,8 +44,6 @@ jobs: - name: install optional dependencies (Linux only) run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev if: runner.os == 'Linux' - - run: > - cargo test --manifest-path cmd/crates/stellar-ledger/Cargo.toml - --features "emulator-tests" -- --nocapture - - run: cargo build --features emulator-tests - - run: cargo test --features emulator-tests --package soroban-test --test it -- emulator + - run: RUST_BACKTRACE=1 cargo test --manifest-path cmd/crates/stellar-ledger/Cargo.toml --features "emulator-tests" -- --nocapture + - run: RUST_BACKTRACE=1 cargo build --features emulator-tests + - run: RUST_BACKTRACE=1 cargo test --features emulator-tests --package soroban-test --test it -- emulator From 9171fb30545c4195838e0c4c873fe9d37bb92912 Mon Sep 17 00:00:00 2001 From: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com> Date: Tue, 22 Apr 2025 10:54:56 -0400 Subject: [PATCH 3/4] Set DOCKER_HOST to colima socket (#1997) --- .github/workflows/ledger-emulator.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ledger-emulator.yml b/.github/workflows/ledger-emulator.yml index 3618b80420..e6b409f5a4 100644 --- a/.github/workflows/ledger-emulator.yml +++ b/.github/workflows/ledger-emulator.yml @@ -41,6 +41,9 @@ jobs: brew install docker brew install colima colima start + - name: Set DOCKER_HOST to Colima socket + if: runner.os == 'macos' + run: echo "DOCKER_HOST=unix:///Users/runner/.colima/default/docker.sock" >> $GITHUB_ENV - name: install optional dependencies (Linux only) run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev if: runner.os == 'Linux' From a7e2fc86ccf079e789497e1bba7c3d9266cb8bcc Mon Sep 17 00:00:00 2001 From: elizabethengelman <4752801+elizabethengelman@users.noreply.github.com> Date: Wed, 23 Apr 2025 12:22:08 -0400 Subject: [PATCH 4/4] Add exclude back in so that only Linux x64 is run on pull requests --- .github/workflows/ledger-emulator.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ledger-emulator.yml b/.github/workflows/ledger-emulator.yml index 45f3d14e95..94b3ffef18 100644 --- a/.github/workflows/ledger-emulator.yml +++ b/.github/workflows/ledger-emulator.yml @@ -25,10 +25,10 @@ jobs: - ubuntu-jammy-16-cores-arm64 # Intel - macos-13 - # exclude: - # # Only run Linux x64 tests on pull request to save some time - # - sys: ${{ github.event_name != 'push' && 'ubuntu-jammy-16-cores-arm64' }} - # - sys: ${{ github.event_name != 'push' && 'macos-13' }} + exclude: + # Only run Linux x64 tests on pull request to save some time + - sys: ${{ github.event_name != 'push' && 'ubuntu-jammy-16-cores-arm64' }} + - sys: ${{ github.event_name != 'push' && 'macos-13' }} runs-on: ${{ matrix.sys }} env: CI_TESTS: true