Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@b01e7a8cfb1f496c52d77361e84c1840d8246393
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979
with:
command: check ${{ matrix.checks }}

Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
sys:
- os: ubuntu-latest
target: wasm32v1-none
cargo-hack-feature-options: --manifest-path Cargo.toml --exclude soroban-meta --exclude soroban-spec --exclude soroban-spec-rust --exclude soroban-ledger-snapshot --exclude-features testutils,docs,default,std --feature-powerset
cargo-hack-feature-options: --manifest-path Cargo.toml --exclude soroban-meta --exclude soroban-spec --exclude soroban-spec-rust --exclude soroban-ledger-snapshot --exclude-features testutils,docs,default,std,experimental_spec_shaking_v2 --feature-powerset
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options: '--feature-powerset --exclude-features docs'
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/test-with-openzeppelin-stellar-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.collect-crates.outputs.dirs) }}
experimental_spec_shaking_v2: [true, false]
defaults:
run:
working-directory: stellar-contracts/${{ matrix.working-directory }}
Expand Down Expand Up @@ -76,19 +77,29 @@ jobs:
sed -i 's|'"$crate"' = { \(.*\)version = "[^"]*"\(.*\)|'"$crate"' = { \1path = "'"$rel_path"'" \2|g' Cargo.toml
done

- name: Enable experimental_spec_shaking_v2 feature
if: matrix.experimental_spec_shaking_v2
working-directory: stellar-contracts
run: |
# Add feature to path-patched entries with existing features
sed -i '/soroban-sdk = {.*path = /s|features = \[|features = ["experimental_spec_shaking_v2", |' Cargo.toml
# Add features field to path-patched entries without features
sed -i '/soroban-sdk = {.*path = /{/features/!s| }|, features = ["experimental_spec_shaking_v2"] }|}' Cargo.toml

- name: Diff
run: (! git diff --exit-code) || (echo 'A diff is expected'; exit 1)

- name: Build contract
if: steps.check-if-contract.outputs.is-a-contract == 'true'
env:
CARGO_BUILD_RUSTFLAGS: "-A deprecated"
SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2: "true"
run: cargo build --target wasm32v1-none --release

- name: Set artifact name
if: steps.check-if-contract.outputs.is-a-contract == 'true'
id: artifact-name
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')" | tee -a $GITHUB_OUTPUT
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')${{ matrix.experimental_spec_shaking_v2 && '-spec-shaking-v2' || '' }}" | tee -a $GITHUB_OUTPUT

- name: Upload WASM artifacts
if: steps.check-if-contract.outputs.is-a-contract == 'true'
Expand All @@ -100,6 +111,7 @@ jobs:

- env:
CARGO_BUILD_RUSTFLAGS: "-A deprecated"
SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2: "true"
run: cargo test

- name: Diff
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/test-with-soroban-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ jobs:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.collect-examples.outputs.dirs) }}
experimental_spec_shaking_v2: [true, false]
# Exclude examples that depend on crates.io packages that transitively
# depend on soroban-sdk (e.g. soroban-poseidon). Cargo does not provide
# a way to override the version of soroban-sdk required as a transitive
# dependency of another dependency where the version to override is a
# different major version or does not match the semver compatibility
# defined by the importer, causing two copies of soroban-sdk to be
# compiled and duplicate lang item (panic_impl) errors.
# https://github.com/stellar/rs-soroban-sdk/issues/1723
exclude:
- working-directory: privacy-pools
defaults:
run:
working-directory: soroban-examples/${{ matrix.working-directory }}
Expand Down Expand Up @@ -92,17 +103,29 @@ jobs:
done
done

- name: Enable experimental_spec_shaking_v2 feature
if: matrix.experimental_spec_shaking_v2
working-directory: soroban-examples
run: |
find . -name Cargo.toml | while read -r file; do
# Add feature to path-patched entries with existing features
sed -i '/soroban-sdk = {.*path = /s|features = \[|features = ["experimental_spec_shaking_v2", |' "$file"
# Add features field to path-patched entries without features
sed -i '/soroban-sdk = {.*path = /{/features/!s| }|, features = ["experimental_spec_shaking_v2"] }|}' "$file"
done

- name: Diff
run: (! git diff --exit-code) || (echo 'A diff is expected'; exit 1)

- name: Build soroban-examples
env:
CARGO_BUILD_RUSTFLAGS: "-A deprecated"
SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2: "true"
run: make build

- name: Set artifact name
id: artifact-name
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')" | tee -a $GITHUB_OUTPUT
run: echo "name=wasm-$(echo ${{ matrix.working-directory }} | sed 's/\//-/g')${{ matrix.experimental_spec_shaking_v2 && '-spec-shaking-v2' || '' }}" | tee -a $GITHUB_OUTPUT

- name: Upload WASM artifacts
uses: actions/upload-artifact@v4
Expand All @@ -114,6 +137,7 @@ jobs:
- name: Test soroban-examples
env:
CARGO_BUILD_RUSTFLAGS: "-A deprecated"
SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2: "true"
run: make test

- name: Diff
Expand Down
Loading
Loading