Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 53 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,48 @@ jobs:
- name: Run contract tests
run: RUSTFLAGS="-A dead_code -A unused_variables" cargo test --lib -- --nocapture

sdk-tests:
name: SDK Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install root dependencies
run: pnpm install --frozen-lockfile

- name: Run SDK unit tests
working-directory: ./packages/sdk
run: pnpm test:unit

- name: Run SDK integration tests
working-directory: ./packages/sdk
run: pnpm test:integration

build-wasm:
name: Build WASM Contracts
runs-on: ubuntu-latest
Expand All @@ -70,6 +112,9 @@ jobs:
toolchain: "1.79.0"
components: rustfmt, clippy
target: wasm32-unknown-unknown
# Disable the default -D warnings injected by this action so that
# unused imports / variables in dependencies don't fail the build.
rustflags: ""

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -87,31 +132,26 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-index-

- name: Build contracts with rust-optimizer
run: |
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.15.1
- name: Build _test.wasm contracts (release + test-vkeys)
run: bash e2e/scripts/build-wasm-local.sh

- name: Verify and list WASM artifacts
run: |
echo "=== Listing generated WASM files ==="
cd artifacts
ls -lh
ls -lh e2e/artifacts/
echo ""
echo "=== WASM file details ==="
for file in *.wasm; do
for file in e2e/artifacts/*_test.wasm; do
if [ -f "$file" ]; then
echo "Found: $file"
echo "Found: $(basename $file)"
fi
done

- name: Upload WASM artifacts
uses: actions/upload-artifact@v4
with:
name: wasm-contracts
path: artifacts/*.wasm
path: e2e/artifacts/*_test.wasm
retention-days: 1

e2e-tests:
Expand All @@ -133,12 +173,12 @@ jobs:
uses: actions/download-artifact@v4
with:
name: wasm-contracts
path: artifacts/
path: e2e/artifacts/

- name: Verify WASM artifacts
run: |
echo "Checking downloaded artifacts..."
ls -lh artifacts/
ls -lh e2e/artifacts/

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ schema:

# Generate schema for individual contracts
schema-amaci:
@cd contracts/amaci && cargo schema
@cd contracts/amaci && cargo schema --features schema

schema-maci:
@cd contracts/maci && cargo schema
Expand Down
6 changes: 3 additions & 3 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
8e81b63d5cb1f8d049da08bcfd5b968a3d25bf7960fc7b399eb134d6eef1a205 cw_amaci-aarch64.wasm
1031ba6d3d0b581057df78e417cfac2123761c7343f39cb46f7c78474b2f79c6 cw_amaci_registry-aarch64.wasm
b87b823e8a0fe10c01932cbd67958c7e9ad1257b0b8ca9a9f71474353527e49f cw_api_saas-aarch64.wasm
cc61ccbba7b73fb75a15468ed45d566b4f858f9f1afa4100f631a16373a26815 cw_amaci-aarch64.wasm
4607bebf17551c904c451b652ce2e0693fee498c1e7ad45e55e54b9747337dd3 cw_amaci_registry-aarch64.wasm
86583bd5db998cff1bd9b45c62e9d207875fa3ae63929d69afeacf4cb3938fab cw_api_saas-aarch64.wasm
9b20be65d366f0c05a678448c3cf90a9717ed394e0e77df5aec71cfed7df80e4 cw_maci-aarch64.wasm
904c160324e3f943f5841e4acfdb61402332c228d3fad4345f9c1f9c0b23f237 cw_test-aarch64.wasm
Loading
Loading