Skip to content

Commit 8e9d892

Browse files
authored
Merge branch 'main' into sanitize-js-bindings-output-dir
2 parents 1767000 + 57f067f commit 8e9d892

56 files changed

Lines changed: 1401 additions & 205 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Docker
3+
4+
on:
5+
workflow_dispatch:
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
permissions: {}
15+
steps:
16+
- run: echo "Building and pushing Docker image..."

.github/workflows/test-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29-
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
29+
- uses: ruby/setup-ruby@6ca151fd1bfcfd6fe0c4eb6837eb0584d0134a0c # v1.290.0
3030
with:
3131
ruby-version: ruby
3232
- name: Run install tests

.github/workflows/test-with-openzeppelin-contracts.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run: rustup update
2525
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
2626
- run: make install
27-
- uses: actions/upload-artifact@v4
27+
- uses: actions/upload-artifact@v7
2828
with:
2929
name: stellar-cli
3030
path: ~/.cargo/bin/stellar
@@ -52,27 +52,50 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
dir: ${{ fromJSON(needs.collect-crates.outputs.dirs) }}
55+
experimental_spec_shaking_v2: [true, false]
5556
runs-on: ubuntu-latest
5657
steps:
5758
- uses: actions/checkout@v6
5859
with:
5960
repository: OpenZeppelin/stellar-contracts
60-
- uses: actions/download-artifact@v4
61+
- uses: actions/download-artifact@v8
6162
with:
6263
name: stellar-cli
6364
path: stellar-cli
6465
- run: chmod +x stellar-cli/stellar
6566
- run: echo "${{ github.workspace }}/stellar-cli" >> $GITHUB_PATH
6667
- run: rustup update
6768
- run: rustup target add wasm32v1-none
69+
- name: Enable experimental_spec_shaking_v2 feature
70+
if: matrix.experimental_spec_shaking_v2
71+
run: |
72+
find . -name Cargo.toml | while read -r file; do
73+
# Add feature to entries with existing features
74+
sed -i '/soroban-sdk = {/s|features = \[|features = ["experimental_spec_shaking_v2", |' "$file"
75+
# Add features field to entries without features
76+
sed -i '/soroban-sdk = {/{/features/!s| }|, features = ["experimental_spec_shaking_v2"] }|}' "$file"
77+
done
78+
cargo update -p soroban-sdk
79+
- name: Diff
80+
run: git diff
6881
- name: Build ${{ matrix.dir }}
6982
run: stellar contract build --manifest-path ${{ matrix.dir }}/Cargo.toml
7083
- name: Find wasm
7184
id: find-wasm
7285
run: |
73-
wasm=$(find . -name '*.wasm' -path '*/wasm32v1-none/*' | head -1)
86+
wasm=$(find . -name '*.wasm' -path '*/wasm32v1-none/release/*' -not -path '*/deps/*' | head -1)
7487
echo "wasm=$wasm" | tee -a $GITHUB_OUTPUT
88+
- name: Set artifact name
89+
id: artifact-name
90+
run: echo "name=wasm-$(echo ${{ matrix.dir }} | sed 's/\//-/g')${{ matrix.experimental_spec_shaking_v2 && '-spec-shaking-v2' || '' }}" | tee -a $GITHUB_OUTPUT
91+
- name: Upload WASM artifacts
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ${{ steps.artifact-name.outputs.name }}
95+
path: ${{ steps.find-wasm.outputs.wasm }}
96+
retention-days: 3
7597
- name: Verify interface
98+
if: ${{ startsWith(matrix.dir, 'examples/') }}
7699
run: |
77100
output=$(stellar contract info interface --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
78101
echo "$output"
@@ -82,6 +105,7 @@ jobs:
82105
exit 1
83106
fi
84107
- name: Verify env-meta
108+
if: ${{ startsWith(matrix.dir, 'examples/') }}
85109
run: |
86110
output=$(stellar contract info env-meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
87111
echo "$output"
@@ -90,6 +114,7 @@ jobs:
90114
exit 1
91115
fi
92116
- name: Verify meta
117+
if: ${{ startsWith(matrix.dir, 'examples/') }}
93118
run: |
94119
output=$(stellar contract info meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
95120
echo "$output"
@@ -98,4 +123,7 @@ jobs:
98123
exit 1
99124
fi
100125
- name: Verify spec
126+
if: ${{ startsWith(matrix.dir, 'examples/') }}
101127
run: stellar contract spec-verify --wasm ${{ steps.find-wasm.outputs.wasm }}
128+
- name: Diff
129+
run: git add -N . && git diff HEAD

.github/workflows/test-with-soroban-examples.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run: rustup update
2525
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
2626
- run: make install
27-
- uses: actions/upload-artifact@v4
27+
- uses: actions/upload-artifact@v7
2828
with:
2929
name: stellar-cli
3030
path: ~/.cargo/bin/stellar
@@ -59,27 +59,49 @@ jobs:
5959
fail-fast: false
6060
matrix:
6161
dir: ${{ fromJSON(needs.collect-examples.outputs.dirs) }}
62+
experimental_spec_shaking_v2: [true, false]
6263
runs-on: ubuntu-latest
6364
steps:
6465
- uses: actions/checkout@v6
6566
with:
6667
repository: stellar/soroban-examples
6768
ref: main
68-
- uses: actions/download-artifact@v4
69+
- uses: actions/download-artifact@v8
6970
with:
7071
name: stellar-cli
7172
path: stellar-cli
7273
- run: chmod +x stellar-cli/stellar
7374
- run: echo "${{ github.workspace }}/stellar-cli" >> $GITHUB_PATH
7475
- run: rustup update
7576
- run: rustup target add wasm32v1-none
77+
- name: Enable experimental_spec_shaking_v2 feature
78+
if: matrix.experimental_spec_shaking_v2
79+
run: |
80+
find . -name Cargo.toml | while read -r file; do
81+
# Add feature to entries with existing features
82+
sed -i '/soroban-sdk = {/s|features = \[|features = ["experimental_spec_shaking_v2", |' "$file"
83+
# Add features field to entries without features
84+
sed -i '/soroban-sdk = {/{/features/!s| }|, features = ["experimental_spec_shaking_v2"] }|}' "$file"
85+
(cd "$(dirname "$file")" && cargo update -p soroban-sdk 2>/dev/null || true)
86+
done
87+
- name: Diff
88+
run: git diff
7689
- name: Build ${{ matrix.dir }}
7790
run: make -C ${{ matrix.dir }} build
7891
- name: Find wasm
7992
id: find-wasm
8093
run: |
81-
wasm=$(find ${{ matrix.dir }}/target -name '*.wasm' -path '*/wasm32v1-none/*' | head -1)
94+
wasm=$(find ${{ matrix.dir }}/target -name '*.wasm' -path '*/wasm32v1-none/release/*' -not -path '*/deps/*' | head -1)
8295
echo "wasm=$wasm" | tee -a $GITHUB_OUTPUT
96+
- name: Set artifact name
97+
id: artifact-name
98+
run: echo "name=wasm-$(echo ${{ matrix.dir }} | sed 's/\//-/g')${{ matrix.experimental_spec_shaking_v2 && '-spec-shaking-v2' || '' }}" | tee -a $GITHUB_OUTPUT
99+
- name: Upload WASM artifacts
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: ${{ steps.artifact-name.outputs.name }}
103+
path: ${{ steps.find-wasm.outputs.wasm }}
104+
retention-days: 3
83105
- name: Verify interface
84106
run: |
85107
output=$(stellar contract info interface --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
@@ -107,3 +129,5 @@ jobs:
107129
fi
108130
- name: Verify spec
109131
run: stellar contract spec-verify --wasm ${{ steps.find-wasm.outputs.wasm }}
132+
- name: Diff
133+
run: git add -N . && git diff HEAD

0 commit comments

Comments
 (0)