|
24 | 24 | - run: rustup update |
25 | 25 | - run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev |
26 | 26 | - run: make install |
27 | | - - uses: actions/upload-artifact@v4 |
| 27 | + - uses: actions/upload-artifact@v7 |
28 | 28 | with: |
29 | 29 | name: stellar-cli |
30 | 30 | path: ~/.cargo/bin/stellar |
@@ -52,27 +52,50 @@ jobs: |
52 | 52 | fail-fast: false |
53 | 53 | matrix: |
54 | 54 | dir: ${{ fromJSON(needs.collect-crates.outputs.dirs) }} |
| 55 | + experimental_spec_shaking_v2: [true, false] |
55 | 56 | runs-on: ubuntu-latest |
56 | 57 | steps: |
57 | 58 | - uses: actions/checkout@v6 |
58 | 59 | with: |
59 | 60 | repository: OpenZeppelin/stellar-contracts |
60 | | - - uses: actions/download-artifact@v4 |
| 61 | + - uses: actions/download-artifact@v8 |
61 | 62 | with: |
62 | 63 | name: stellar-cli |
63 | 64 | path: stellar-cli |
64 | 65 | - run: chmod +x stellar-cli/stellar |
65 | 66 | - run: echo "${{ github.workspace }}/stellar-cli" >> $GITHUB_PATH |
66 | 67 | - run: rustup update |
67 | 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 |
68 | 81 | - name: Build ${{ matrix.dir }} |
69 | 82 | run: stellar contract build --manifest-path ${{ matrix.dir }}/Cargo.toml |
70 | 83 | - name: Find wasm |
71 | 84 | id: find-wasm |
72 | 85 | 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) |
74 | 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 |
75 | 97 | - name: Verify interface |
| 98 | + if: ${{ startsWith(matrix.dir, 'examples/') }} |
76 | 99 | run: | |
77 | 100 | output=$(stellar contract info interface --wasm ${{ steps.find-wasm.outputs.wasm }} --output json) |
78 | 101 | echo "$output" |
|
82 | 105 | exit 1 |
83 | 106 | fi |
84 | 107 | - name: Verify env-meta |
| 108 | + if: ${{ startsWith(matrix.dir, 'examples/') }} |
85 | 109 | run: | |
86 | 110 | output=$(stellar contract info env-meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json) |
87 | 111 | echo "$output" |
|
90 | 114 | exit 1 |
91 | 115 | fi |
92 | 116 | - name: Verify meta |
| 117 | + if: ${{ startsWith(matrix.dir, 'examples/') }} |
93 | 118 | run: | |
94 | 119 | output=$(stellar contract info meta --wasm ${{ steps.find-wasm.outputs.wasm }} --output json) |
95 | 120 | echo "$output" |
|
98 | 123 | exit 1 |
99 | 124 | fi |
100 | 125 | - name: Verify spec |
| 126 | + if: ${{ startsWith(matrix.dir, 'examples/') }} |
101 | 127 | run: stellar contract spec-verify --wasm ${{ steps.find-wasm.outputs.wasm }} |
| 128 | + - name: Diff |
| 129 | + run: git add -N . && git diff HEAD |
0 commit comments