Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-rpc-bugs' into fix-rpc-bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya1702 committed Jun 17, 2024
2 parents 1dc4020 + 662b2a8 commit b3cd836
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 3,422 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/bump-version.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/publish.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/required_status_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# workaround to simplify terraform management of required status checks,
# see https://github.com/orgs/community/discussions/12377
name: "Required status check"
on:
pull_request:

jobs:
complete:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: int128/wait-for-workflows-action@v1
with:
filter-workflow-names: |
Dependency sanity checker*
Linters*
Rust*
Soroban RPC*
101 changes: 3 additions & 98 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,106 +10,11 @@ defaults:
shell: bash

jobs:

complete:
if: always()
needs: [ fmt, build-and-test, publish-dry-run ]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

fmt:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: cargo fmt --all --check

build-and-test:
strategy:
fail-fast: false
matrix:
rust: [ msrv, latest ]
include:
- 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-8-cores
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- name: Use the minimum supported Rust version
if: matrix.rust == 'msrv'
run: |
msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')"
rustup override set $msrv
rustup component add clippy --toolchain $msrv
- name: Error on warnings and clippy checks
# Only error on warnings and checks for the msrv, because new versions of
# Rust will frequently add new warnings and checks.
if: matrix.rust == 'msrv'
run: echo RUSTFLAGS='-Dwarnings -Dclippy::all -Dclippy::pedantic' >> $GITHUB_ENV
- run: rustup update
- run: cargo version
- run: rustup target add ${{ matrix.target }}
- run: rustup target add wasm32-unknown-unknown
- if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- run: cargo clippy --all-targets --target ${{ matrix.target }}
- run: make build-test
- if: startsWith(matrix.target, 'x86_64')
# specify directories explicitly to avoid building the preflight library (otherwise it will fail with missing symbols)
run: |
for I in cmd/crates/* ; do
cargo test --target ${{ matrix.target }} --manifest-path $I/Cargo.toml
done
publish-dry-run:
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options: --feature-powerset
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
cargo-hack-feature-options: --feature-powerset
- os: macos-latest
target: x86_64-apple-darwin
cargo-hack-feature-options: --feature-powerset
- os: macos-latest
target: aarch64-apple-darwin
cargo-hack-feature-options: --feature-powerset
# Windows builds notes:
#
# The different features that need testing are split over unique
# isolated builds for Windows, because there's a bug in Cargo [1] that
# causes builds of wasm-opt [2] to fail when run one after the other and
# attempting to clean up artifacts in between. The bug has been fixed,
# but will not make it into a stable release of Cargo until ~August
# 2023.
#
# [1]: https://github.com/rust-lang/cargo/pull/11442
# [2]: https://github.com/brson/wasm-opt-rs/issues/116
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
cargo-hack-feature-options: ''
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
cargo-hack-feature-options: --features opt --ignore-unknown-features
uses: stellar/actions/.github/workflows/rust-publish-dry-run-v2.yml@main
with:
crates: stellar-rpc-client
runs-on: ${{ matrix.os }}
target: ${{ matrix.target }}
cargo-hack-feature-options: ${{ matrix.cargo-hack-feature-options }}
- run: make rust-check
- run: make rust-test
25 changes: 7 additions & 18 deletions .github/workflows/soroban-rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ jobs:
- uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go }}
- name: Build soroban contract fixtures
run: |
rustup update
rustup target add wasm32-unknown-unknown
make build-test-wasms
- run: rustup update
- run: make build-libpreflight
- run: go test -race -cover -timeout 25m -v ./cmd/soroban-rpc/...

Expand Down Expand Up @@ -65,10 +61,6 @@ jobs:
with:
go-version: 1.22

- run: |
rustup target add ${{ matrix.rust_target }}
rustup update
# On windows, make sure we have the same compiler (linker) used by rust.
# This is important since the symbols names won't match otherwise.
- if: matrix.os == 'windows-latest'
Expand All @@ -86,6 +78,10 @@ jobs:
sudo apt-get install -y gcc-10-aarch64-linux-gnu
echo 'CC=aarch64-linux-gnu-gcc-10' >> $GITHUB_ENV
- run: |
rustup target add ${{ matrix.rust_target }}
rustup update
- name: Build libpreflight
run: make build-libpreflight
env:
Expand Down Expand Up @@ -138,14 +134,6 @@ jobs:
- uses: stellar/actions/rust-cache@main

- name: Build soroban contract fixtures
shell: bash
run: |
rustup update
rustup target add wasm32-unknown-unknown
make build_rust
make build-test-wasms
- name: Install Captive Core
shell: bash
run: |
Expand Down Expand Up @@ -187,11 +175,12 @@ jobs:
echo "Docker Compose Version:"
docker-compose version
- run: rustup update

- name: Build libpreflight
shell: bash
run: make build-libpreflight

- name: Run Soroban RPC Integration Tests
run: |
make install_rust
go test -race -timeout 60m -v ./cmd/soroban-rpc/internal/test/...
Loading

0 comments on commit b3cd836

Please sign in to comment.