diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb58041bc..ba6c7a175 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,6 @@ jobs: run: make install-katana - name: Run tests run: | - make fetch-ssj-artifacts cp .env.example .env make run-nodes & make test-end-to-end diff --git a/Makefile b/Makefile index 3fc968c24..d309d0aa8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ifneq ("$(wildcard .env)","") export $(shell sed 's/=.*//' .env) endif -.PHONY: build test coverage +.PHONY: build test coverage clean # 154615699 corresponds to release v0.1.7 of Kakarot SSJ. KKRT_SSJ_RELEASE_ID = 154615699 @@ -13,28 +13,28 @@ KKRT_SSJ_BUILD_ARTIFACT_URL = $(shell curl -L https://api.github.com/repos/kkrt- KATANA_VERSION = v1.0.0-alpha.11 ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +BUILD_DIR = build +SSJ_DIR = $(BUILD_DIR)/ssj +SSJ_ZIP = dev-artifacts.zip -build: check - $(MAKE) clean +build: $(SSJ_DIR) check poetry run python ./kakarot_scripts/compile_kakarot.py check: poetry check --lock +$(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)" + fetch-ef-tests: poetry run python ./kakarot_scripts/ef_tests/fetch.py -# This action fetches the latest Kakarot SSJ (Cairo compiler version >=2) artifacts -# from the main branch and unzips them into the build/ssj directory. -# This is required because Kakarot Zero (Cairo Zero, compiler version <1) uses some SSJ Cairo programs. -# Most notably for precompiles. -fetch-ssj-artifacts: - rm -rf build/ssj - mkdir -p build/ssj - @curl -sL -o dev-artifacts.zip "$(KKRT_SSJ_BUILD_ARTIFACT_URL)" - unzip -o dev-artifacts.zip -d build/ssj - rm -f dev-artifacts.zip - setup: fetch-ssj-artifacts poetry install @@ -45,7 +45,6 @@ test: deploy test-unit: build-sol poetry run pytest tests/src -m "not NoCI" -n logical --seed 42 -# run make run-nodes in other terminal test-end-to-end: deploy poetry run pytest tests/end_to_end --seed 42 @@ -59,9 +58,10 @@ format-check: trunk check --ci clean: - rm -rf build/*.json - rm -rf build/fixtures/*.json - mkdir -p build + rm -rf $(BUILD_DIR)/*.json + rm -rf $(BUILD_DIR)/fixtures/*.json + rm -rf $(SSJ_DIR) + mkdir -p $(BUILD_DIR) check-resources: poetry run python kakarot_scripts/check_resources.py