Skip to content

Commit

Permalink
chore: fetch ssj release (#1482)
Browse files Browse the repository at this point in the history
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR:

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying,
or link to a relevant issue. -->

Resolves #<Issue number>

## What is the new behavior?

Use ssj repo to fetch its artifacts

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1482)
<!-- Reviewable:end -->
  • Loading branch information
obatirou authored Oct 9, 2024
1 parent 4dc30c2 commit 14d2811
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 39 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/ssj-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches:
- main
paths:
- cairo/kakarot-ssj/**
pull_request: {}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -17,25 +16,48 @@ concurrency:
permissions: read-all

jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
crates: ${{ steps.filter.outputs.crates }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
crates:
- 'cairo/kakarot-ssj/crates/**'
ssj-build:
needs: paths-filter
if: needs.paths-filter.outputs.crates == 'true'
uses: ./.github/workflows/ssj-build.yml
with:
artifact-name: ssj-build

ssj-tests-unit:
needs: paths-filter
if: needs.paths-filter.outputs.crates == 'true'
uses: ./.github/workflows/ssj-tests-unit.yml
with:
run-fmt-check: false

ssj-ef-tests:
uses: ./.github/workflows/ssj-ef-tests.yml
needs: [ssj-build]
needs:
- ssj-build
- paths-filter
if: needs.paths-filter.outputs.crates == 'true'
with:
artifact-name: ssj-build

ssj-resources:
runs-on: ubuntu-latest
needs: [ssj-ef-tests]
needs:
- ssj-ef-tests
- paths-filter
if: needs.paths-filter.outputs.crates == 'true'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/ssj-test.yml

This file was deleted.

20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,27 @@ endif

.PHONY: build test coverage clean

# 176384150 corresponds to release v0.1.13 of Kakarot SSJ.
KKRT_SSJ_RELEASE_ID = 176384150
# Kakarot SSJ artifacts for precompiles.
KKRT_SSJ_BUILD_ARTIFACT_URL = $(shell curl -L https://api.github.com/repos/kkrt-labs/kakarot-ssj/releases/${KKRT_SSJ_RELEASE_ID} | jq -r '.assets[0].browser_download_url')
KATANA_VERSION = v1.0.0-alpha.14
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

BUILD_DIR = build
SSJ_DIR = $(BUILD_DIR)/ssj
SSJ_ZIP = dev-artifacts.zip

build-ssj:
@echo "Building Kakarot SSJ"
@mkdir -p $(SSJ_DIR)
@cd cairo/kakarot-ssj && scarb build -p contracts && find target/dev -type f -name '*contracts*' | grep -vE 'test|mock|Mock' | xargs -I {} cp {} ../../$(SSJ_DIR)
$(SSJ_DIR): $(SSJ_ZIP)
rm -rf $(SSJ_DIR)
mkdir -p $(SSJ_DIR)
unzip -o $(SSJ_ZIP) -d $(SSJ_DIR)
rm -f $(SSJ_ZIP)

$(SSJ_ZIP):
curl -sL -o $(SSJ_ZIP) "$(KKRT_SSJ_BUILD_ARTIFACT_URL)"

build: build-ssj
build: $(SSJ_DIR)
uv run compile

deploy: build build-sol
Expand Down
2 changes: 1 addition & 1 deletion docker/deployer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ RUN git clone --depth 1 https://github.com/asdf-vm/asdf.git "$HOME/.asdf" && \
RUN source "$HOME/.asdf/asdf.sh" && asdf plugin add scarb && asdf install scarb 0.7.0 && asdf install scarb 2.6.5 && asdf install scarb 2.8.3

RUN --mount=type=cache,target=/root/.cache \
source "$HOME/.asdf/asdf.sh" && source "$HOME/.cargo/env" && make build-ssj && make build && make build-sol
source "$HOME/.asdf/asdf.sh" && source "$HOME/.cargo/env" && make build && make build-sol


############################################
Expand Down

0 comments on commit 14d2811

Please sign in to comment.