Skip to content

Commit

Permalink
Basic example to run Cairo 1 programs (lambdaclass#1370)
Browse files Browse the repository at this point in the history
* Add basic example for running Cairo 1 programs

* FileWriter

* Fix issue

* Fix cargo lock

* Fix typo

* CLI for cairo1 run

* CLI

* Test for the cli

* Clone corelib, add it to ignore

* Delete pub, set bincode to workspace

* Delete corelib

* New line

* Remove corelib, download it

* .Phony

* Add readme documentation

* change place of doc in readme

* Run with release

* Try running all files

* Fix makefile to compile everything

* add workflow

* Endlines

* test workflow

* change on in workflow

* yaml fix

* change on in workflow

* change on in workflow

* Fix typo

* Fix cairo vm dependecy

* Modify changelog

* Modify workflow

* Clone with https

* use cairo1 run makefile

* Add cairo 1 programs

* Pin cairo version to 2.2.0

* Update documentation

* Update workflow

* Add cairo 1 program

* Update dependencies

* Update test workflow

* Extract entrypoint from function name

* Extract return values from main func and distinguish panics (First darft, needs cleaning)

* Improve return values output

* Show panick data

* Parse panic data

* Remove TODO & some unwraps

* Add newline at end of file

* Use fixed entrypoint

* Validate values in tests 7 fix return values

* Fix test

* fmt

* clippy

* Remove unwraps

* Bump cairo imports version

* Bump dep version

* fmt

---------

Co-authored-by: Milton <milton.scuderi@lambdaclass.com>
Co-authored-by: mmsc2 <88055861+mmsc2@users.noreply.github.com>
Co-authored-by: Pedro Fontana <fontana.pedro93@gmail.com>
Co-authored-by: Federica <fedemoletta@hotmail.com>
Co-authored-by: fmoletta <99273364+fmoletta@users.noreply.github.com>
  • Loading branch information
6 people authored Oct 12, 2023
1 parent a47c0c8 commit 4598416
Show file tree
Hide file tree
Showing 25 changed files with 876 additions and 38 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/cairo_1_programs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Cairo 1 programs execution

on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]

jobs:
run:
name: Execute programs
runs-on: ubuntu-22.04
steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.69.0
- name: Set up Cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
uses: actions/checkout@v3
- name: install corelib
run: cd cairo1-run/ && make deps
- name: Run tests
run: cd cairo1-run/ && make test
- name: Run cairo 1 programs
run: cd cairo1-run/ && make run
5 changes: 5 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ jobs:
with:
tool: cargo-nextest@0.9.49,cargo-llvm-cov,wasm-pack

- name: Install cairo 1 dependencies for running programs
run: |
cd cairo1-run
make deps
- name: Run ${{ matrix.target }}
run: |
# this splits the `test#1` into `test` and `1`
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ cairo-vm-pypy-env/*
/cairo2/
/cairo-lang/
*.tar
cairo1-run/corelib/
cairo-vm-cli/air_input.pub

ensure-no_std/Cargo.lock

!vm/src/tests/cairo_pie_test_output.json
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Upcoming Changes

* feat: Implement a CLI to run cairo programs [#1370](https://github.com/lambdaclass/cairo-vm/pull/1370)

* fix: Fix string code of `BLAKE2S_ADD_UINT256` hint [#1454](https://github.com/lambdaclass/cairo-vm/pull/1454)

#### [0.9.0] - 2023-10-03
Expand Down
Loading

0 comments on commit 4598416

Please sign in to comment.