Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CLI builds and tests on all platforms #237

Merged
merged 42 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6d6be48
Run CLI builds and tests on all platforms
leighmcculloch Oct 29, 2022
daf3698
use bash
leighmcculloch Oct 29, 2022
f3c25ef
fix
leighmcculloch Oct 29, 2022
2085416
use defaults
leighmcculloch Oct 31, 2022
a1f682d
Merge branch 'main' into platforms
leighmcculloch Oct 31, 2022
759d769
workflow
leighmcculloch Oct 31, 2022
5c66e44
fix
leighmcculloch Oct 31, 2022
8c26c3c
fix
leighmcculloch Oct 31, 2022
d85ba48
fix
leighmcculloch Oct 31, 2022
12e926f
fix
leighmcculloch Oct 31, 2022
8f6cd8b
Merge branch 'main' into platforms
leighmcculloch Oct 31, 2022
3b923f3
empty commit
leighmcculloch Nov 1, 2022
53934bc
try publish dry run and publish
leighmcculloch Nov 3, 2022
f7a475b
fix
leighmcculloch Nov 3, 2022
63aba84
update deps
leighmcculloch Nov 3, 2022
13e375e
fix
leighmcculloch Nov 3, 2022
8b7b0b9
set version
leighmcculloch Nov 3, 2022
a2d8396
disable temp
leighmcculloch Nov 3, 2022
f8a8beb
Merge branch 'main' into platforms
leighmcculloch Nov 3, 2022
a51b472
fmt
leighmcculloch Nov 3, 2022
3c1a74c
fix
leighmcculloch Nov 3, 2022
606c61a
undo
leighmcculloch Nov 3, 2022
cdf5bf9
reenable
leighmcculloch Nov 3, 2022
3867ae2
targetg
leighmcculloch Nov 3, 2022
5c7b9ea
fix
leighmcculloch Nov 3, 2022
780ddcd
move things about
leighmcculloch Nov 3, 2022
741477d
empty commit
leighmcculloch Nov 3, 2022
3f9ba6d
empty commit
leighmcculloch Nov 3, 2022
d42035f
empty commit
leighmcculloch Nov 3, 2022
bffe99d
empty commit
leighmcculloch Nov 3, 2022
7a0bb9d
empty commit
leighmcculloch Nov 3, 2022
b3c147b
empty commit
leighmcculloch Nov 4, 2022
4ae115c
empty commit
leighmcculloch Nov 4, 2022
83c9f72
empty commit
leighmcculloch Nov 4, 2022
4b14ce7
empty commit
leighmcculloch Nov 4, 2022
1915395
empty commit
leighmcculloch Nov 4, 2022
34fc099
empty commit
leighmcculloch Nov 4, 2022
3058e3f
empty commit
leighmcculloch Nov 4, 2022
af7b8f7
try fixing lf<>crlf
leighmcculloch Nov 4, 2022
769de44
empty commit
leighmcculloch Nov 4, 2022
1351538
ready for merge
leighmcculloch Nov 4, 2022
cd835b5
upd when publish dry run runs to match sdk
leighmcculloch Nov 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cargo.lock text -merge eol=lf
22 changes: 15 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [published]

defaults:
run:
shell: bash

jobs:

publish:
Expand All @@ -19,15 +23,13 @@ jobs:
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
apt-install: gcc-aarch64-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
# TODO: Re-enable when this job is updated to support Windows.
# - os: windows-latest
# target: x86_64-pc-windows-msvc
# ext: .exe
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: .exe
runs-on: ${{ matrix.os }}
env:
VERSION: '${{ github.event.release.release.name }}'
Expand All @@ -36,16 +38,22 @@ jobs:
- uses: actions/checkout@v3
- run: rustup update
- run: rustup target add ${{ matrix.target }}
- if: matrix.apt-install
run: sudo apt-get -y install ${{ matrix.apt-install }}
- if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Package
run: cargo package --no-verify
- name: Build
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
run: |
cd target/package
tar xvfz soroban-cli-$VERSION.crate
cd soroban-cli-$VERSION
cargo build --target-dir=../.. --release --target ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: ${{ env.NAME }}
path: 'target/${{ matrix.target }}/release/soroban${{ matrix.ext }}'
- name: Upload
uses: actions/github-script@v6
with:
Expand Down
35 changes: 29 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ name: Rust

on:
push:
branches: [main]
branches: [main, release/**]
pull_request:

env:
RUSTFLAGS: -Dwarnings -Dclippy::all -Dclippy::pedantic

defaults:
run:
shell: bash

jobs:

complete:
Expand Down Expand Up @@ -38,17 +42,28 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- 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
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- run: rustup update
- run: rustup target add ${{ matrix.target }}
- if: matrix.target == 'aarch64-unknown-linux-gnu'
run: 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-wasms
- run: cargo test --workspace --target ${{ matrix.target }}
- if: startsWith(matrix.target, 'x86_64')
run: cargo test --workspace --target ${{ matrix.target }}

e2e-test:
strategy:
Expand All @@ -71,13 +86,21 @@ jobs:
- run: cargo test --test it --target ${{ matrix.target }} -- e2e_rpc_server --ignored --test-threads 1

publish-dry-run:
if: startsWith(github.head_ref, 'release/')
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
strategy:
matrix:
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
target: x86_64-pc-windows-msvc
uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main
with:
runs-on: ${{ matrix.os }}
cargo-package-options: --target ${{ matrix.target }}
target: ${{ matrix.target }}
76 changes: 36 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@ members = [
default-members = ["."]

[workspace.dependencies]
soroban-env-host = "0.0.6"
soroban-spec = "0.1.0"
soroban-token-spec = "0.1.0"
soroban-auth = "0.1.0"
soroban-env-host = "0.0.9"
soroban-spec = "0.2.0"
soroban-token-spec = "0.2.0"
soroban-auth = "0.2.0"
stellar-strkey = "0.0.6"
soroban-sdk = "0.1.0"
soroban-sdk = "0.2.0"

[patch.crates-io]
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" }
soroban-token-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" }
soroban-auth = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" }
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" }
soroban-sdk-macros = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" }
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" }
soroban-token-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" }
soroban-auth = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" }
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" }
soroban-sdk-macros = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" }
stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "d1b68fd1" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" }
soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "3ba13687" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" }
soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "e88f9fa7" }
wasmi = { package = "soroban-wasmi", git = "https://github.com/stellar/wasmi", rev = "d1ec0036" }

# soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" }
Expand Down
4 changes: 2 additions & 2 deletions src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub fn commit<'a, I>(
output_file: &std::path::PathBuf,
) -> Result<(), Error>
where
I: IntoIterator<Item = (&'a LedgerKey, &'a Option<LedgerEntry>)>,
I: IntoIterator<Item = (&'a Box<LedgerKey>, &'a Option<Box<LedgerEntry>>)>,
{
//Need to start off with the existing snapshot (new_state) since it's possible the storage_map did not touch every existing entry
if let Some(dir) = output_file.parent() {
Expand All @@ -106,7 +106,7 @@ where
let file = File::create(output_file)?;
for (lk, ole) in storage_map {
if let Some(le) = ole {
new_state.insert(lk.clone(), le.clone());
new_state.insert(*lk.clone(), *(*le).clone());
} else {
new_state.remove(lk);
}
Expand Down
2 changes: 1 addition & 1 deletion src/token/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl Cmd {
)?)
.await?;

Ok(hex::encode(&contract_id))
Ok(hex::encode(contract_id))
}
}

Expand Down
Loading