diff --git a/.github/workflows/ssj-ci.yml b/.github/workflows/ssj-ci.yml index 144b61f68..0ce4e3128 100644 --- a/.github/workflows/ssj-ci.yml +++ b/.github/workflows/ssj-ci.yml @@ -4,8 +4,7 @@ on: push: branches: - main - paths: - - cairo/kakarot-ssj/** + pull_request: {} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -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 diff --git a/.github/workflows/ssj-test.yml b/.github/workflows/ssj-test.yml deleted file mode 100644 index b3dc169c7..000000000 --- a/.github/workflows/ssj-test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: SSJ-CI - -permissions: read-all - -on: - pull_request: - paths: - - cairo/kakarot-ssj/** - -concurrency: - group: ssj-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - ssj-build: - uses: ./.github/workflows/ssj-build.yml - with: - artifact-name: ssj-build - - ssj-tests-unit: - uses: ./.github/workflows/ssj-tests-unit.yml - with: - run-fmt-check: true - - ssj-ef-tests: - uses: ./.github/workflows/ssj-ef-tests.yml - needs: [ssj-build] - with: - artifact-name: ssj-build diff --git a/Makefile b/Makefile index 49593abcf..9b5080471 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docker/deployer/Dockerfile b/docker/deployer/Dockerfile index 55cadaf4f..ee4ab82cb 100644 --- a/docker/deployer/Dockerfile +++ b/docker/deployer/Dockerfile @@ -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 ############################################