diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a991cb5f30..569be0051c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: - main pull_request: - + env: CARGO_TERM_COLOR: always RUST_VERSION: 1.80.0 @@ -27,6 +27,142 @@ jobs: name: dojo-bins path: bins + dojo-tests: + needs: build + runs-on: arc-runner-set + env: + KATANA_ADDR: "127.0.0.1" + KATANA_PORT: "5050" + KATANA_NO_MINING_PORT: "5051" + KATANA_NO_FEE_PORT: "5052" + KATANA_NO_ACCOUNT_VALIDATION_PORT: "5053" + KATANA_OPENRPC_PORT: "5054" + PAYMASTER_PRIVATE_KEY: "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912" + PAYMASTER_ACCOUNT_ADDRESS: "0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec" + UDC_ADDRESS: "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf" + ACCOUNT_CLASS_HASH: "0x07dc7899aa655b0aae51eadff6d801a58e97dd99cf4666ee59e704249e51adf2" + SCARB_VERSION: "2.8.4" + steps: + - uses: actions/checkout@v3 + + - name: Install build dependencies + run: | + sudo apt-get update && \ + sudo apt-get install -y build-essential libclang-dev git curl bash libssl-dev pkg-config + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Install Scarb + run: | + export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH" + curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | bash -s -- -v $SCARB_VERSION + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Download katana binary + uses: actions/download-artifact@v4 + with: + name: dojo-bins + path: /tmp/bins + + - run: chmod +x /tmp/bins/katana + + - name: Start katana nodes + run: | + declare -A KATANA_CONFIG=( + ["${KATANA_PORT}"]="" + ["${KATANA_OPENRPC_PORT}"]="" + ["${KATANA_NO_MINING_PORT}"]="--no-mining --dev" + ["${KATANA_NO_FEE_PORT}"]="--dev --dev.no-fee" + ["${KATANA_NO_ACCOUNT_VALIDATION_PORT}"]="--dev --dev.no-account-validation" + ) + + for PORT in "${!KATANA_CONFIG[@]}"; do + /tmp/bins/katana \ + --http.port "${PORT}" \ + --http.addr "${KATANA_ADDR}" \ + --silent \ + ${KATANA_CONFIG[$PORT]} & + done + + - name: Checkout katana-runner repository + uses: actions/checkout@v3 + with: + repository: neotheprogramist/starknet-rpc-tests + path: katana-runner + + - name: Scarb build + run: | + scarb build + working-directory: katana-runner + + - name: Build openrpc-testgen-runner + run: | + cargo build --release --features "openrpc katana katana_no_mining katana_no_fee katana_no_account_validation" -p openrpc-testgen -p openrpc-testgen-runner + working-directory: katana-runner + + - name: Run Katana Suite + run: | + URLS="http://${KATANA_ADDR}:${KATANA_PORT}" + target/release/openrpc-testgen-runner \ + --urls "${URLS}" \ + --paymaster-account-address "${PAYMASTER_ACCOUNT_ADDRESS}" \ + --paymaster-private-key "${PAYMASTER_PRIVATE_KEY}" \ + --udc-address "${UDC_ADDRESS}" \ + --account-class-hash "${ACCOUNT_CLASS_HASH}" \ + --suite katana + working-directory: katana-runner + + - name: Run OpenRPC Suite + run: | + URLS="http://${KATANA_ADDR}:${KATANA_OPENRPC_PORT}" + target/release/openrpc-testgen-runner \ + --urls "${URLS}" \ + --paymaster-account-address "${PAYMASTER_ACCOUNT_ADDRESS}" \ + --paymaster-private-key "${PAYMASTER_PRIVATE_KEY}" \ + --udc-address "${UDC_ADDRESS}" \ + --account-class-hash "${ACCOUNT_CLASS_HASH}" \ + --suite open-rpc + working-directory: katana-runner + + - name: Run Katana No Mining Suite + run: | + URLS="http://${KATANA_ADDR}:${KATANA_NO_MINING_PORT}" + target/release/openrpc-testgen-runner \ + --urls "${URLS}" \ + --paymaster-account-address "${PAYMASTER_ACCOUNT_ADDRESS}" \ + --paymaster-private-key "${PAYMASTER_PRIVATE_KEY}" \ + --udc-address "${UDC_ADDRESS}" \ + --account-class-hash "${ACCOUNT_CLASS_HASH}" \ + --suite katana-no-mining + working-directory: katana-runner + + - name: Run Katana No Fee Suite + run: | + URLS="http://${KATANA_ADDR}:${KATANA_NO_FEE_PORT}" + target/release/openrpc-testgen-runner \ + --urls "${URLS}" \ + --paymaster-account-address "${PAYMASTER_ACCOUNT_ADDRESS}" \ + --paymaster-private-key "${PAYMASTER_PRIVATE_KEY}" \ + --udc-address "${UDC_ADDRESS}" \ + --account-class-hash "${ACCOUNT_CLASS_HASH}" \ + --suite katana-no-fee + working-directory: katana-runner + + - name: Run Katana No Account Validation Suite + run: | + URLS="http://${KATANA_ADDR}:${KATANA_NO_ACCOUNT_VALIDATION_PORT}" + target/release/openrpc-testgen-runner \ + --urls "${URLS}" \ + --paymaster-account-address "${PAYMASTER_ACCOUNT_ADDRESS}" \ + --paymaster-private-key "${PAYMASTER_PRIVATE_KEY}" \ + --udc-address "${UDC_ADDRESS}" \ + --account-class-hash "${ACCOUNT_CLASS_HASH}" \ + --suite katana-no-account-validation + working-directory: katana-runner + + test: needs: ensure-docker runs-on: ubuntu-latest-32-cores diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index eede640d83..cad83f3f33 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -1,4 +1,5 @@ name: release-dispatch + on: workflow_dispatch: inputs: