Skip to content

Commit

Permalink
Merge branch 'main' into add-working-with-multisig
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Nov 25, 2024
2 parents f911314 + 62ce556 commit 02c1222
Show file tree
Hide file tree
Showing 103 changed files with 2,808 additions and 1,162 deletions.
75 changes: 70 additions & 5 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ jobs:
crate:
- name: stellar-cli
binary: stellar
- name: soroban-cli
binary: soroban
sys:
- os: ubuntu-20.04 # Use 20.04 to get an older version of glibc for increased compat
target: x86_64-unknown-linux-gnu
- os: ubuntu-20.04 # Use 20.04 to get an older version of glibc for increased compat
target: aarch64-unknown-linux-gnu
- os: macos-14
target: x86_64-apple-darwin
- os: macos-12
target: aarch64-apple-darwin
- os: macos-14
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: .exe
Expand All @@ -46,41 +44,50 @@ jobs:
- uses: actions/checkout@v4
- run: rustup update
- run: rustup target add ${{ matrix.sys.target }}

- if: matrix.sys.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libudev-dev

- name: Setup vars
run: |
version="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "stellar-cli") | .version')"
echo "VERSION=${version}" >> $GITHUB_ENV
echo "NAME=${{ matrix.crate.name }}-${version}-${{ matrix.sys.target }}" >> $GITHUB_ENV
- name: Package (release only)
if: github.event_name == 'release'
run: cargo package --no-verify --package ${{ matrix.crate.name }}

- name: Package Extract (release only)
if: github.event_name == 'release'
run: |
cd target/package
tar xvfz ${{ matrix.crate.name }}-$VERSION.crate
echo "BUILD_WORKING_DIR=target/package/${{ matrix.crate.name }}-$VERSION" >> $GITHUB_ENV
- name: Build
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
working-directory: ${{ env.BUILD_WORKING_DIR }}
run: cargo build --target-dir="$GITHUB_WORKSPACE/target" --package ${{ matrix.crate.name }} --features opt --release --target ${{ matrix.sys.target }}

- name: Build provenance for attestation (release only)
if: github.event_name == 'release'
uses: actions/attest-build-provenance@v1
with:
subject-path: target/${{ matrix.sys.target }}/release/${{ matrix.crate.binary }}${{ matrix.sys.ext }}

- name: Compress
run: |
cd target/${{ matrix.sys.target }}/release
tar czvf $NAME.tar.gz ${{ matrix.crate.binary }}${{ matrix.sys.ext }}
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.NAME }}
name: ${{ env.NAME }}.tar.gz
path: 'target/${{ matrix.sys.target }}/release/${{ env.NAME }}.tar.gz'

- name: Upload to Release (release only)
if: github.event_name == 'release'
uses: actions/github-script@v7
Expand All @@ -94,3 +101,61 @@ jobs:
name: '${{ env.NAME }}.tar.gz',
data: fs.readFileSync('target/${{ matrix.sys.target }}/release/${{ env.NAME }}.tar.gz'),
});
installer:
needs: build
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Setup vars
run: |
version="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "stellar-cli") | .version')"
installer_basename="stellar-cli-installer-${version}-x86_64-pc-windows-msvc"
echo "VERSION=${version}" >> $GITHUB_ENV
echo "STELLAR_CLI_INSTALLER_BASENAME=${installer_basename}" >> $GITHUB_ENV
echo "STELLAR_CLI_INSTALLER=${installer_basename}.exe" >> $GITHUB_ENV
echo "ARTIFACT_NAME=stellar-cli-${version}-x86_64-pc-windows-msvc.tar.gz" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}

- name: Uncompress Artifact
run: tar xvf ${{ env.ARTIFACT_NAME }}

- name: Build Installer
shell: powershell
run: |
$Env:Path += ";C:\Users\$Env:UserName\AppData\Local\Programs\Inno Setup 6"
$Env:STELLAR_CLI_VERSION = "${{ env.VERSION }}"
ISCC.exe installer.iss
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.STELLAR_CLI_INSTALLER }}
path: Output/stellar-installer.exe

- name: Build provenance for attestation (release only)
if: github.event_name == 'release'
uses: actions/attest-build-provenance@v1
with:
subject-path: ${{ env.STELLAR_CLI_INSTALLER }}

- name: Upload to Release (release only)
if: github.event_name == 'release'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ github.event.release.id }},
name: '${{ env.STELLAR_CLI_INSTALLER }}',
data: fs.readFileSync('Output/stellar-installer.exe'),
});
35 changes: 17 additions & 18 deletions .github/workflows/rpc-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: RPC Tests
on:
push:
Expand All @@ -15,32 +14,32 @@ jobs:
runs-on: ubuntu-22.04
services:
rpc:
image: stellar/quickstart:v438-testing
image: stellar/quickstart:testing
ports:
- 8000:8000
env:
ENABLE_LOGS: true
ENABLE_SOROBAN_DIAGNOSTIC_EVENTS: true
NETWORK: local
PROTOCOL_VERSION: 22
options: >-
--health-cmd "curl --no-progress-meter --fail-with-body -X POST \"http://localhost:8000/soroban/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'"
--health-interval 10s
--health-timeout 5s
--health-retries 50
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update
- run: cargo build
- run: rustup target add wasm32-unknown-unknown
- run: make build-test-wasms
- run: SOROBAN_PORT=8000 cargo test --features it --package soroban-test --test it -- integration

- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update
- run: cargo build
- run: rustup target add wasm32-unknown-unknown
- run: make build-test-wasms
- run: SOROBAN_PORT=8000 cargo test --features it --package soroban-test --test it -- integration
49 changes: 30 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

complete:
if: always()
needs: [fmt, check-generated-full-help-docs, build-and-test, publish-dry-run]
needs: [fmt, cargo-deny, check-generated-full-help-docs, build-and-test, publish-dry-run]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
Expand All @@ -30,6 +30,19 @@ jobs:
- run: rustup update
- run: cargo fmt --all --check

cargo-deny:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [advisories, bans, licenses, sources]
continue-on-error: ${{ matrix.check == 'advisories' || matrix.check == 'bans' || matrix.check == 'licenses' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@b01e7a8cfb1f496c52d77361e84c1840d8246393
with:
command: check ${{ matrix.check }}

check-generated-full-help-docs:
runs-on: ubuntu-latest-16-cores
steps:
Expand All @@ -44,18 +57,18 @@ jobs:
fail-fast: false
matrix:
rust: [msrv, latest]
include:
sys:
- os: ubuntu-latest-16-cores
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest-16-cores
- os: ubuntu-jammy-16-cores-arm64
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 }}
runs-on: ${{ matrix.sys.os }}
env:
CI_TESTS: true
steps:
Expand All @@ -74,18 +87,15 @@ jobs:
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 ${{ matrix.sys.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 (otherwise it will fail with missing symbols)
run: |
for I in cmd/soroban-cli cmd/crates/* cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world ; do
cargo test --target ${{ matrix.target }} --manifest-path $I/Cargo.toml
done
- if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libudev-dev
- run: cargo clippy --all-targets --target ${{ matrix.sys.target }}
- run: make test
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_BUILD_TARGET: ${{ matrix.sys.target }}

publish-dry-run:
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
Expand All @@ -97,10 +107,11 @@ jobs:
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options: --feature-powerset
additional-deb-packages: libudev-dev
# - os: ubuntu-latest-16-cores
# target: aarch64-unknown-linux-gnu
# cargo-hack-feature-options: --feature-powerset
# additional-deb-packages: libudev-dev libssl-dev
# TODO: add back ARM support
#- os: ubuntu-latest-16-cores
# target: aarch64-unknown-linux-gnu
# cargo-hack-feature-options: --feature-powerset
# additional-deb-packages: libudev-dev libssl-dev
- os: macos-latest
target: x86_64-apple-darwin
cargo-hack-feature-options: --feature-powerset
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ test_snapshots
.vscode/settings.json
.idea
local.sh
.stellar
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ changes quickly.

## Setting up development environment

There are 2 ways to being developing stellar-cli:
There are 2 ways to begin developing stellar-cli:

### Installing all required dependencies

Expand Down
Loading

0 comments on commit 02c1222

Please sign in to comment.