From 57e9c9329cb12a18406f83b374d3af3de9f2ad58 Mon Sep 17 00:00:00 2001 From: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:33:55 -0400 Subject: [PATCH] build: add bindings ts tests to ci Add tests from https://github.com/AhaLabs/soroban-tools/pull/11 which didn't make it into https://github.com/stellar/soroban-tools/pull/973 due to the quickstart image not starting properly in CI. Adding this directly to https://github.com/stellar/soroban-tools/pull/973 was costing too much time. We can troubleshoot quickstart issues here. --- .github/workflows/bindings-ts.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/bindings-ts.yml diff --git a/.github/workflows/bindings-ts.yml b/.github/workflows/bindings-ts.yml new file mode 100644 index 0000000000..3b9a9f09bb --- /dev/null +++ b/.github/workflows/bindings-ts.yml @@ -0,0 +1,50 @@ + +name: bindings typescript + +on: + push: + branches: [main, release/**] + pull_request: + +jobs: + test: + name: test generated libraries + runs-on: ubuntu-22.04 + services: + rpc: + image: stellar/quickstart:testing@sha256:c1030a6ee75c31ba6807b8feddded2af23789b5f2c9be3ac55a550630a35ef42 + ports: + - 8000:8000 + env: + ENABLE_LOGS: true + NETWORK: local + ENABLE_SOROBAN_RPC: true + options: >- + --health-cmd "curl --no-progress-meter --fail-with-body -X POST \"http://localhost:8000/soroban/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'" + --health-interval 10s + --health-timeout 5s + --health-retries 50 + steps: + - run: echo $CARGO_TARGET_DIR + - uses: actions/checkout@v3 + - run: "curl --fail-with-body -X POST \"http://localhost:8000/soroban/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}'" + - run: curl --no-progress-meter "http://localhost:8000/friendbot?addr=$(./soroban config identity address)" + working-directory: cmd/crates/soroban-spec-typescript/ts-tests + - run: ./soroban config identity fund --network standalone + working-directory: cmd/crates/soroban-spec-typescript/ts-tests + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - run: rustup update + - run: cargo build + - run: rustup target add wasm32-unknown-unknown + - run: make build-test-wasms + - run: curl "http://localhost:8000/friendbot?addr=$(./soroban config identity address)" + - run: npm ci && npm run test + working-directory: cmd/crates/soroban-spec-typescript/ts-tests