Skip to content

Commit 3780a29

Browse files
authored
Merge branch 'main' into remove-auth-entry-source-signer
2 parents 162eb33 + 8a6c883 commit 3780a29

Some content is hidden

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

78 files changed

+3451
-365
lines changed

.github/workflows/binaries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
echo "DEB_PKG_DIR=stellar-cli_${version}_${{ matrix.arch }}" >> $GITHUB_ENV
116116
117117
- name: Download Artifact
118-
uses: actions/download-artifact@v7
118+
uses: actions/download-artifact@v8
119119
with:
120120
name: ${{ env.ARTIFACT_NAME }}
121121

@@ -170,7 +170,7 @@ jobs:
170170
echo "SM_CLIENT_CERT_FILE=D:\\sm_client_cert.p12" >> "$GITHUB_ENV"
171171
172172
- name: Download Artifact
173-
uses: actions/download-artifact@v7
173+
uses: actions/download-artifact@v8
174174
with:
175175
name: ${{ env.ARTIFACT_NAME }}
176176

.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
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Test with OpenZeppelin contracts
2+
3+
on:
4+
push:
5+
branches: [main, release/**]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions: {}
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
build-cli:
20+
runs-on: ubuntu-latest-8-cores
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: stellar/actions/rust-cache@main
24+
- run: rustup update
25+
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
26+
- run: make install
27+
- uses: actions/upload-artifact@v7
28+
with:
29+
name: stellar-cli
30+
path: ~/.cargo/bin/stellar
31+
32+
collect-crates:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
dirs: ${{ steps.dirs.outputs.dirs }}
36+
steps:
37+
- uses: actions/checkout@v6
38+
with:
39+
repository: OpenZeppelin/stellar-contracts
40+
- id: dirs
41+
run: |
42+
dirs=$(cargo metadata --no-deps --format-version 1 \
43+
| jq -r --arg pwd "$(pwd)" \
44+
'[.workspace_members[] as $id | .packages[] | select(.id == $id) | select(any(.dependencies[]; .name == "soroban-sdk") and any(.targets[]; any(.crate_types[]; . == "cdylib"))) | .manifest_path | sub("^\($pwd)/"; "") | sub("/Cargo.toml$"; "")] | tojson' \
45+
)
46+
echo "dirs=$dirs" | tee -a $GITHUB_OUTPUT
47+
48+
build-crate:
49+
needs: [build-cli, collect-crates]
50+
if: ${{ needs.collect-crates.outputs.dirs != '[]' }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
dir: ${{ fromJSON(needs.collect-crates.outputs.dirs) }}
55+
experimental_spec_shaking_v2: [true, false]
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v6
59+
with:
60+
repository: OpenZeppelin/stellar-contracts
61+
- uses: actions/download-artifact@v8
62+
with:
63+
name: stellar-cli
64+
path: stellar-cli
65+
- run: chmod +x stellar-cli/stellar
66+
- run: echo "${{ github.workspace }}/stellar-cli" >> $GITHUB_PATH
67+
- run: rustup update
68+
- 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
81+
- name: Build ${{ matrix.dir }}
82+
run: stellar contract build --manifest-path ${{ matrix.dir }}/Cargo.toml
83+
- name: Find wasm
84+
id: find-wasm
85+
run: |
86+
wasm=$(find . -name '*.wasm' -path '*/wasm32v1-none/release/*' -not -path '*/deps/*' | head -1)
87+
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
97+
- name: Verify interface
98+
if: ${{ startsWith(matrix.dir, 'examples/') }}
99+
run: |
100+
output=$(stellar contract info interface --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
101+
echo "$output"
102+
count=$(echo "$output" | jq 'length')
103+
if [ "$count" -lt 1 ]; then
104+
echo "ERROR: interface is empty"
105+
exit 1
106+
fi
107+
- name: Verify env-meta
108+
if: ${{ startsWith(matrix.dir, 'examples/') }}
109+
run: |
110+
output=$(stellar contract info env-meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
111+
echo "$output"
112+
if [ "$(echo "$output" | jq 'length')" -lt 1 ]; then
113+
echo "ERROR: env-meta is empty"
114+
exit 1
115+
fi
116+
- name: Verify meta
117+
if: ${{ startsWith(matrix.dir, 'examples/') }}
118+
run: |
119+
output=$(stellar contract info meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
120+
echo "$output"
121+
if [ "$(echo "$output" | jq 'length')" -lt 1 ]; then
122+
echo "ERROR: meta is empty"
123+
exit 1
124+
fi
125+
- name: Verify spec
126+
if: ${{ startsWith(matrix.dir, 'examples/') }}
127+
run: stellar contract spec-verify --wasm ${{ steps.find-wasm.outputs.wasm }}
128+
- name: Diff
129+
run: git add -N . && git diff HEAD
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Test with soroban-examples
2+
3+
on:
4+
push:
5+
branches: [main, release/**]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions: {}
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
build-cli:
20+
runs-on: ubuntu-latest-8-cores
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: stellar/actions/rust-cache@main
24+
- run: rustup update
25+
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
26+
- run: make install
27+
- uses: actions/upload-artifact@v7
28+
with:
29+
name: stellar-cli
30+
path: ~/.cargo/bin/stellar
31+
32+
collect-examples:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
dirs: ${{ steps.dirs.outputs.dirs }}
36+
steps:
37+
- uses: actions/checkout@v6
38+
with:
39+
repository: stellar/soroban-examples
40+
ref: main
41+
- id: dirs
42+
run: |
43+
dirs=$(
44+
for dir in $(find . -type f -name 'Makefile' -mindepth 2 | xargs dirname | sed 's|^\./||'); do
45+
if (cargo metadata --manifest-path "$dir/Cargo.toml" --no-deps --format-version 1 \
46+
| jq -r \
47+
'.packages[0] | (any(.dependencies[]; .name == "soroban-sdk") and any(.targets[]; any(.crate_types[]; . == "cdylib")))' \
48+
| grep -q '^true$'); then
49+
echo "$dir"
50+
fi
51+
done | jq -Rnc '[inputs | "\(.)"]'
52+
)
53+
echo "dirs=$dirs" | tee -a $GITHUB_OUTPUT
54+
55+
build-example:
56+
needs: [build-cli, collect-examples]
57+
if: ${{ needs.collect-examples.outputs.dirs != '[]' }}
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
dir: ${{ fromJSON(needs.collect-examples.outputs.dirs) }}
62+
experimental_spec_shaking_v2: [true, false]
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v6
66+
with:
67+
repository: stellar/soroban-examples
68+
ref: main
69+
- uses: actions/download-artifact@v8
70+
with:
71+
name: stellar-cli
72+
path: stellar-cli
73+
- run: chmod +x stellar-cli/stellar
74+
- run: echo "${{ github.workspace }}/stellar-cli" >> $GITHUB_PATH
75+
- run: rustup update
76+
- 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
89+
- name: Build ${{ matrix.dir }}
90+
run: make -C ${{ matrix.dir }} build
91+
- name: Find wasm
92+
id: find-wasm
93+
run: |
94+
wasm=$(find ${{ matrix.dir }}/target -name '*.wasm' -path '*/wasm32v1-none/release/*' -not -path '*/deps/*' | head -1)
95+
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
105+
- name: Verify interface
106+
run: |
107+
output=$(stellar contract info interface --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
108+
echo "$output"
109+
count=$(echo "$output" | jq 'length')
110+
if [ "$count" -lt 1 ]; then
111+
echo "ERROR: interface is empty"
112+
exit 1
113+
fi
114+
- name: Verify env-meta
115+
run: |
116+
output=$(stellar contract info env-meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
117+
echo "$output"
118+
if [ "$(echo "$output" | jq 'length')" -lt 1 ]; then
119+
echo "ERROR: env-meta is empty"
120+
exit 1
121+
fi
122+
- name: Verify meta
123+
run: |
124+
output=$(stellar contract info meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json)
125+
echo "$output"
126+
if [ "$(echo "$output" | jq 'length')" -lt 1 ]; then
127+
echo "ERROR: meta is empty"
128+
exit 1
129+
fi
130+
- name: Verify spec
131+
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)