Skip to content

Commit 136d391

Browse files
committed
wip
0 parents  commit 136d391

File tree

544 files changed

+87462
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

544 files changed

+87462
-0
lines changed

.config/nextest.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[profile.ci]
2+
# Do not cancel the test run on the first failure.
3+
fail-fast = false
4+
slow-timeout = { period = "60s", terminate-after = 10 , grace-period = "0s"}

.dockerignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# --- Version Control ---
2+
.git
3+
.gitignore
4+
.gitmodules
5+
6+
# --- Documentation ---
7+
docs/
8+
README.md
9+
10+
# --- Local Environments & Caches ---
11+
.venv/
12+
venv/
13+
.uv-cache/
14+
__pycache__/
15+
.pytest_cache/
16+
.ruff_cache/
17+
.mypy_cache/
18+
19+
# --- Rust & Scarb Build Artifacts ---
20+
target/
21+
.snfoundry_cache/
22+
23+
# --- IDEs & OS ---
24+
.idea/
25+
.vscode/
26+
.DS_Store
27+
28+
# --- Local Configuration ---
29+
*.env
30+
example.env
31+
Makefile

.github/workflows/build-cli.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Build CLI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version number (e.g., v1.0.0)'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
create_release:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
upload_url: ${{ steps.create_release.outputs.upload_url }}
19+
steps:
20+
- name: Create Release
21+
id: create_release
22+
uses: softprops/action-gh-release@v1
23+
with:
24+
tag_name: ${{ inputs.version }}
25+
name: ${{ inputs.version }}
26+
draft: false
27+
prerelease: false
28+
generate_release_notes: true
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
build_and_upload_compiled_program:
32+
needs: create_release
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout Code
36+
uses: actions/checkout@v3
37+
with:
38+
submodules: true
39+
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v6
42+
with:
43+
enable-cache: true
44+
45+
- name: Set up Cairo
46+
run: uv sync
47+
48+
- name: Build
49+
run: |
50+
.venv/bin/cairo-compile --cairo_path=packages/eth_essentials src/hdp.cairo --output sound_run_compiled.json --no_debug_info
51+
.venv/bin/cairo-compile --cairo_path=packages/eth_essentials src/contract_bootloader/contract_dry_run.cairo --output dry_run_compiled.json --no_debug_info
52+
53+
- name: Upload to release
54+
uses: svenstaro/upload-release-action@v2
55+
with:
56+
repo_token: ${{ secrets.GITHUB_TOKEN }}
57+
file: sound_run_compiled.json
58+
asset_name: sound_run_compiled.json
59+
tag: ${{ inputs.version }}
60+
overwrite: true
61+
62+
- name: Upload to release
63+
uses: svenstaro/upload-release-action@v2
64+
with:
65+
repo_token: ${{ secrets.GITHUB_TOKEN }}
66+
file: dry_run_compiled.json
67+
asset_name: dry_run_compiled.json
68+
tag: ${{ inputs.version }}
69+
overwrite: true
70+
71+
build_and_upload_cli:
72+
needs: create_release
73+
runs-on: ${{ matrix.platform.os }}
74+
strategy:
75+
matrix:
76+
platform:
77+
- os: ubuntu-24.04
78+
binary_path: target/release/hdp-cli
79+
asset_name: hdp-cli-linux-amd64
80+
81+
- os: ubuntu-24.04-arm
82+
binary_path: target/release/hdp-cli
83+
asset_name: hdp-cli-linux-arm64
84+
85+
- os: macos-13
86+
binary_path: target/release/hdp-cli
87+
asset_name: hdp-cli-macos-amd64
88+
89+
- os: macos-15
90+
binary_path: target/release/hdp-cli
91+
asset_name: hdp-cli-macos-arm64
92+
93+
steps:
94+
- name: Checkout Code
95+
uses: actions/checkout@v3
96+
with:
97+
submodules: true
98+
99+
- name: Install uv
100+
uses: astral-sh/setup-uv@v6
101+
with:
102+
enable-cache: true
103+
104+
- name: Set up Rust
105+
uses: actions-rust-lang/setup-rust-toolchain@v1
106+
107+
- name: Cargo Cache
108+
uses: actions/cache@v3
109+
with:
110+
path: |
111+
~/.cargo/bin/
112+
~/.cargo/registry/index/
113+
~/.cargo/registry/cache/
114+
~/.cargo/git/db/
115+
target/
116+
~/.cache/nextest
117+
key: ${{ runner.os }}-${{ matrix.platform.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Scarb.toml') }}
118+
restore-keys: |
119+
${{ runner.os }}-${{ matrix.platform.os }}-cargo-
120+
121+
- name: Set up Cairo (Linux)
122+
if: runner.os == 'Linux'
123+
run: uv sync
124+
125+
- name: Set up Cairo (macOS)
126+
if: runner.os == 'macOS'
127+
run: CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib uv sync
128+
129+
- name: Build
130+
uses: actions-rs/cargo@v1
131+
with:
132+
command: build
133+
args: --release --bin hdp-cli
134+
135+
- name: Upload binaries to release
136+
uses: svenstaro/upload-release-action@v2
137+
with:
138+
repo_token: ${{ secrets.GITHUB_TOKEN }}
139+
file: ${{ matrix.platform.binary_path }}
140+
asset_name: ${{ matrix.platform.asset_name }}
141+
tag: ${{ inputs.version }}
142+
overwrite: true
143+
144+
upload_program_hash_file:
145+
needs: create_release
146+
runs-on: ubuntu-latest
147+
steps:
148+
- name: Checkout Code
149+
uses: actions/checkout@v3
150+
with:
151+
submodules: true
152+
153+
- name: Install uv
154+
uses: astral-sh/setup-uv@v6
155+
with:
156+
enable-cache: true
157+
158+
- name: Set up Rust
159+
uses: actions-rust-lang/setup-rust-toolchain@v1
160+
161+
- name: Cargo Cache
162+
uses: actions/cache@v3
163+
with:
164+
path: |
165+
~/.cargo/bin
166+
~/.cargo/registry/index
167+
~/.cargo/registry/cache
168+
~/.cargo/git/db
169+
target
170+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
171+
restore-keys: |
172+
${{ runner.os }}-cargo-
173+
174+
- name: Set up Cairo
175+
run: uv sync
176+
177+
- name: Get Program Hash
178+
run: |
179+
hash=$(cargo run --release --bin hdp-cli -- program-hash | tr -d '\n')
180+
echo "PROGRAM_HASH=$hash" >> $GITHUB_ENV
181+
182+
- name: Create file with program hash as filename
183+
run: |
184+
echo "$PROGRAM_HASH" > "./${PROGRAM_HASH}"
185+
186+
- name: Upload program hash file to release
187+
uses: svenstaro/upload-release-action@v2
188+
with:
189+
repo_token: ${{ secrets.GITHUB_TOKEN }}
190+
file: ${{ env.PROGRAM_HASH }}
191+
asset_name: ${{ env.PROGRAM_HASH }}
192+
tag: ${{ inputs.version }}
193+
overwrite: true

.github/workflows/mdbook.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deploy mdBook site to Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v3
23+
with:
24+
submodules: true
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
enable-cache: true
30+
31+
- name: Set up Rust
32+
uses: actions-rust-lang/setup-rust-toolchain@v1
33+
34+
- name: Cargo Cache
35+
uses: actions/cache@v3
36+
with:
37+
path: |
38+
~/.cargo/bin
39+
~/.cargo/registry/index
40+
~/.cargo/registry/cache
41+
~/.cargo/git/db
42+
target
43+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-cargo-
46+
47+
- name: Set up Cairo
48+
run: uv sync
49+
50+
- name: Setup mdBook
51+
uses: peaceiris/actions-mdbook@v2
52+
with:
53+
mdbook-version: '0.4.45'
54+
55+
- name: Setup Pages
56+
id: pages
57+
uses: actions/configure-pages@v5
58+
59+
- name: Build with mdBook from ./docs
60+
run: mdbook build docs
61+
62+
- name: Create program_hash JSON file
63+
run: |
64+
echo "{ \"program_hash\": \"$(cargo run --release --bin hdp-cli -- program-hash | tr -d '\n')\" }" > ./docs/book/program_hash.json
65+
66+
- name: Upload artifact
67+
uses: actions/upload-pages-artifact@v3
68+
with:
69+
path: ./docs/book
70+
71+
deploy:
72+
environment:
73+
name: hdp-docs
74+
url: ${{ steps.deployment.outputs.page_url }}
75+
runs-on: ubuntu-latest
76+
needs: build
77+
steps:
78+
- name: Deploy to GitHub Pages
79+
id: deployment
80+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)