Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use openrpc-testgen tool for RPC testing #2799

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
03ae67a
Modify workflows - tmp.
Uacias Dec 3, 2024
bf946f9
Modify name ci.
Uacias Dec 3, 2024
da023b4
Jobs runn on arc-runners.
Uacias Dec 3, 2024
57e11d7
arc runner set
Uacias Dec 3, 2024
6358bf0
arc runner set
Uacias Dec 3, 2024
9111e11
Modify workflow.
Uacias Dec 3, 2024
8e04de6
modify workflow.
Uacias Dec 3, 2024
a698dd6
Modify workflow.
Uacias Dec 3, 2024
b94d358
Use podman.
Uacias Dec 4, 2024
7c09e49
Easier podmani nstall.
Uacias Dec 4, 2024
5b0a03f
Sudo.
Uacias Dec 4, 2024
f687607
v2 workflow.
Uacias Dec 4, 2024
fd0abb7
Add scarb.
Uacias Dec 4, 2024
3db23b0
Fix asdf.
Uacias Dec 4, 2024
f01b611
run instant.
Uacias Dec 4, 2024
b8bf98b
Verify build.
Uacias Dec 4, 2024
cf5e3f4
fix
Uacias Dec 4, 2024
d87d54a
Simplify.
Uacias Dec 5, 2024
4a422aa
Revert "Simplify."
Uacias Dec 5, 2024
a7b5bbf
Make use of repo variables.
Uacias Dec 5, 2024
01ec474
v3 vars.
Uacias Dec 5, 2024
5a7fa34
Envs in workflow.
Uacias Dec 5, 2024
a2331b0
Add cache v3.
Uacias Dec 5, 2024
a1f4992
Revert "Add cache v3."
Uacias Dec 5, 2024
97d82cf
Install scarb cargo.
Uacias Dec 5, 2024
5c1fe14
not only dispatch.
Uacias Dec 5, 2024
1b2e746
Install scarb.
Uacias Dec 5, 2024
8f6b508
Rm permissions.
Uacias Dec 5, 2024
9c8bd3f
add exec.
Uacias Dec 5, 2024
cb8e99e
Check permissions.
Uacias Dec 6, 2024
2aa10f8
Simplify
Uacias Dec 6, 2024
388cae8
Add openssl.
Uacias Dec 6, 2024
0b75127
Add libssl-dev pkg-config.
Uacias Dec 6, 2024
2b7cbb3
v4.
Uacias Dec 6, 2024
a3e445f
V4fix.
Uacias Dec 6, 2024
3fbd79a
v4 ls.
Uacias Dec 6, 2024
fa961ab
v4 two suites.
Uacias Dec 6, 2024
81a6d25
v4 small fix.
Uacias Dec 6, 2024
8b35204
Small fix.
Uacias Dec 6, 2024
d33fa46
Rm https.
Uacias Dec 6, 2024
3774479
Fix url.
Uacias Dec 6, 2024
7070cbc
set working directory
Uacias Dec 6, 2024
5b6e5bd
Add no fee & no acc validation suites.
Uacias Dec 9, 2024
6a89226
No acc validation.
Uacias Dec 9, 2024
c8e46cd
Echo test visoft.
Uacias Dec 9, 2024
a841a8b
Rm echo.
Uacias Dec 9, 2024
d8dda27
Echo.
Uacias Dec 9, 2024
414de20
Echo rm
Uacias Dec 9, 2024
fb19b14
Test.
Uacias Dec 9, 2024
baf7d38
v5
Uacias Dec 9, 2024
8f53825
Rm v3 v5
Uacias Dec 10, 2024
762233d
Add openrpc.
Uacias Dec 10, 2024
cb743dc
Ci tmp.
Uacias Dec 11, 2024
3591079
on push.
Uacias Dec 11, 2024
59cccac
RM redundant cache.
Uacias Dec 11, 2024
78fe5e1
Better version of running, rm redundancy.
Uacias Dec 11, 2024
3012d8b
Hola.
Uacias Dec 12, 2024
2d69bf6
Testing new bin.
Uacias Dec 12, 2024
db136b5
final check.
Uacias Dec 12, 2024
071ca37
Final.
Uacias Dec 12, 2024
13f7f50
Final version in ci.yaml.
Uacias Dec 12, 2024
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
138 changes: 137 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
pull_request:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.80.0
Expand All @@ -27,6 +27,142 @@ jobs:
name: dojo-bins
path: bins

dojo-tests:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dojo-tests:
starknet-rpc:

Wondering if this should be in the same file since we may not want to run this at every CI, only when crates/katana path is actually modified. cc @kariy

needs: build
runs-on: arc-runner-set
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From where this runner set is coming from?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is deployed on our visoft cluster.

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"
Uacias marked this conversation as resolved.
Show resolved Hide resolved
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

Uacias marked this conversation as resolved.
Show resolved Hide resolved
- 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

Uacias marked this conversation as resolved.
Show resolved Hide resolved
- 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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: release-dispatch

on:
workflow_dispatch:
inputs:
Expand Down
Loading