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

Cache cairo-vm-cli in the CI build #2707

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
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
53 changes: 49 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
SKIP: ormolu,format-juvix-files,typecheck-juvix-examples
VAMPIRREPO: anoma/vamp-ir
VAMPIRVERSION: v0.1.3
CAIRO_VM_VERSION: 42e04161de82d7e5381258def4b65087c8944660

jobs:
pre-commit:
Expand Down Expand Up @@ -95,6 +96,9 @@ jobs:
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH

- run: echo "HOME=$HOME" >> $GITHUB_ENV
shell: bash

- name: Install the latest Wasmer version
uses: jaxxstorm/action-install-gh-release@v1.10.0
with:
Expand All @@ -119,17 +123,36 @@ jobs:
run: |
vamp-ir --version

- name: Cache CairoVM
id: cache-cairo-vm
uses: actions/cache@v4
with:
path: ${{ env.HOME }}/.local/bin/cairo-vm-cli
key: ${{ runner.os }}-cairo-vm-${{ env.CAIRO_VM_VERSION }}

- name: Install Rust toolchain
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Checkout CairoVM
uses: actions/checkout@v4
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
with:
repository: lambdaclass/cairo-vm
path: cairo-vm
ref: ${{ env.CAIRO_VM_VERSION }}

- name: Install Cairo VM
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
shell: bash
run: |
git clone https://github.com/lambdaclass/cairo-vm.git
cd cairo-vm
cargo build --release
cp target/release/cairo-vm-cli $HOME/.local/bin/cairo-vm-cli
cd -

- name: Install run_cairo_vm.sh
shell: bash
run: |
cp main/scripts/run_cairo_vm.sh $HOME/.local/bin/run_cairo_vm.sh

- name: Make runtime
Expand Down Expand Up @@ -293,18 +316,40 @@ jobs:
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH

- run: echo "HOME=$HOME" >> $GITHUB_ENV
shell: bash

- name: Cache CairoVM
id: cache-cairo-vm
uses: actions/cache@v4
with:
path: ${{ env.HOME }}/.local/bin/cairo-vm-cli
key: ${{ runner.os }}-cairo-vm-${{ env.CAIRO_VM_VERSION }}

- name: Install Rust toolchain
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Checkout CairoVM
uses: actions/checkout@v4
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
with:
repository: lambdaclass/cairo-vm
path: cairo-vm
ref: ${{ env.CAIRO_VM_VERSION }}

- name: Install Cairo VM
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
shell: bash
run: |
git clone https://github.com/lambdaclass/cairo-vm.git
cd cairo-vm
cargo build --release
cp -a target/release/cairo-vm-cli $HOME/.local/bin/cairo-vm-cli
chmod a+x $HOME/.local/bin/cairo-vm-cli
cd -

- name: Install run_cairo_vm.sh
shell: bash
run: |
cp -a main/scripts/run_cairo_vm.sh $HOME/.local/bin/run_cairo_vm.sh
chmod a+x $HOME/.local/bin/run_cairo_vm.sh

Expand Down
Loading