Skip to content

Commit

Permalink
feat(katana) : add explorer flag and build folder (#2997)
Browse files Browse the repository at this point in the history
* feat: add explorer flag and build folder

* chore: remove warnings and modify startup workflow

* chore: remove build files

* feat: add updated env config

* chore: update commit hash

* chore: update env variable

* chore: add coderabbit changes

* chore: update with explorer crate and rust-embed

* chore: add build files and remove submodule config

* chore: resolve coderabbit comments

* style and move all explorer into its own crate

* parse url

* chore: update to use submodule in build in ci

* chore: update with advanced path sanitization

* Update .gitignore

* chore: update remote url

* prevent explorer port from being 0 in the cli

* chore: update ci workflow

* chore: add ci logs

* chore: add additional logs

* chore: update ci

* chore: make force submodule add

* chore: add dependency in test workflow

* chore: update workflow

* fix: clippy and docs workflow

---------

Co-authored-by: Ammar Arif <[email protected]>
  • Loading branch information
ayushtom and kariy authored Feb 28, 2025
1 parent 9fba033 commit 429f238
Show file tree
Hide file tree
Showing 11 changed files with 491 additions and 10 deletions.
83 changes: 75 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,46 @@ env:
RUST_VERSION: 1.81.0

jobs:
build-explorer:
runs-on: ubuntu-latest
needs: [fmt, cairofmt]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Initialize submodules
run: |
git submodule add -f -b main https://github.com/cartridge-gg/explorer crates/katana/explorer/ui
ls -la
ls -la crates/katana/explorer/ui || echo "Explorer dir not found"
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Build Explorer UI
run: |
cd crates/katana/explorer/ui
bun install
bun run build
- uses: actions/upload-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist

build:
runs-on: ubuntu-latest-4-cores
needs: [fmt, cairofmt]
needs: [fmt, cairofmt, build-explorer]
container:
image: ghcr.io/dojoengine/dojo-dev:v1.2.2
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist
- uses: Swatinem/rust-cache@v2
- run: |
cargo build -r --bin katana
Expand All @@ -31,7 +64,7 @@ jobs:
path: bins

test:
needs: ensure-docker
needs: [ensure-docker, build-explorer]
runs-on: ubuntu-latest-32-cores
container:
image: ghcr.io/dojoengine/dojo-dev:v1.2.2
Expand All @@ -42,6 +75,13 @@ jobs:
with:
name: dojo-bins
path: /tmp/bins
- uses: actions/download-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist
- name: Verify explorer UI assets
run: |
ls -la crates/katana/explorer/ui/dist || echo "Explorer UI dist directory not found"
- run: |
export PATH=/tmp/bins:$PATH
chmod +x /tmp/bins/katana
Expand All @@ -58,18 +98,25 @@ jobs:

ensure-wasm:
runs-on: ubuntu-latest
needs: [fmt, cairofmt]
needs: [fmt, cairofmt, build-explorer]
container:
image: ghcr.io/dojoengine/dojo-dev:v1.2.2
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist
- name: Verify explorer UI assets
run: |
ls -la crates/katana/explorer/ui/dist || echo "Explorer UI dist directory not found"
- name: Install wasm32 target
run: rustup target add wasm32-unknown-unknown
- run: cargo build -r --target wasm32-unknown-unknown -p torii-client

ensure-windows:
needs: ensure-docker
needs: [ensure-docker, build-explorer]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -78,6 +125,13 @@ jobs:
toolchain: ${{ env.rust_version }}
target: x86_64-pc-windows-msvc
- uses: swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist
- name: Verify explorer UI assets
run: |
dir crates\katana\explorer\ui\dist || echo "Explorer UI dist directory not found"
- uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.github_token }}
Expand Down Expand Up @@ -162,12 +216,19 @@ jobs:
clippy:
runs-on: ubuntu-latest-4-cores
needs: [fmt, cairofmt]
needs: [fmt, cairofmt, build-explorer]
container:
image: ghcr.io/dojoengine/dojo-dev:v1.2.2
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist
- name: Verify explorer UI assets
run: |
ls -la crates/katana/explorer/ui/dist || echo "Explorer UI dist directory not found"
- run: scripts/clippy.sh

fmt:
Expand All @@ -181,14 +242,20 @@ jobs:

docs:
runs-on: ubuntu-latest
needs: [fmt, cairofmt]
needs: [fmt, cairofmt, build-explorer]
container:
image: ghcr.io/dojoengine/dojo-dev:v1.2.2
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- run: >
scripts/docs.sh
- uses: actions/download-artifact@v4
with:
name: explorer-dist
path: crates/katana/explorer/ui/dist
- name: Verify explorer UI assets
run: |
ls -la crates/katana/explorer/ui/dist || echo "Explorer UI dist directory not found"
- run: scripts/docs.sh

test-hurl:
needs: build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ examples/spawn-and-move/manifests/saya/**
**/*.log

artifacts/

crates/katana/explorer/ui
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
[submodule "crates/katana/contracts/piltover"]
path = crates/katana/contracts/piltover
url = https://github.com/keep-starknet-strange/piltover.git
[submodule "crates/katana/explorer/ui"]
path = crates/katana/explorer/ui
url = https://github.com/cartridge-gg/explorer
branch = main
73 changes: 72 additions & 1 deletion Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ members = [
"crates/katana/cli",
"crates/katana/controller",
"crates/katana/core",
"crates/katana/explorer",
"crates/katana/executor",
"crates/katana/feeder-gateway",
"crates/katana/grpc",
Expand Down Expand Up @@ -98,6 +99,7 @@ katana-codecs-derive = { path = "crates/katana/storage/codecs/derive" }
katana-core = { path = "crates/katana/core", default-features = false }
katana-db = { path = "crates/katana/storage/db" }
katana-executor = { path = "crates/katana/executor" }
katana-explorer = { path = "crates/katana/explorer" }
katana-feeder-gateway = { path = "crates/katana/feeder-gateway" }
katana-messaging = { path = "crates/katana/messaging" }
katana-node = { path = "crates/katana/node", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/katana/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version.workspace = true
[dependencies]
katana-chain-spec.workspace = true
katana-core.workspace = true
katana-explorer.workspace = true
katana-messaging.workspace = true
katana-node.workspace = true
katana-primitives.workspace = true
Expand Down
Loading

0 comments on commit 429f238

Please sign in to comment.