Skip to content

Commit

Permalink
dev: pull compiled contracts of Kakarot system from kakarot CI artifa…
Browse files Browse the repository at this point in the history
…cts instead of Git Submodule (#532)

* pull compiled contracts of Kakarot

* Remove .gitmodules

* Make .env file optional

* Update CI

* Remove useless kakarot.yml workflow

* Remove useless `export`
  • Loading branch information
khaeljy authored Oct 12, 2023
1 parent 90604a7 commit fad6e52
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 53 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
checks: write
contents: read

submodules:
name: Compile Kakarot contracts
uses: ./.github/workflows/kakarot.yml

tests:
name: Rust tests
uses: ./.github/workflows/test.yml
needs: submodules
35 changes: 0 additions & 35 deletions .github/workflows/kakarot.yml

This file was deleted.

10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- name: Load compiled kakarot contracts
id: cached-contracts
uses: actions/cache/restore@v3
with:
path: ./lib/kakarot/build
key: ${{ runner.os }}-contracts
- name: Setup rust env
uses: actions-rs/toolchain@v1
with:
Expand All @@ -32,6 +26,10 @@ jobs:
uses: Swatinem/rust-cache@v2
- name: fetch ef tests
run: make setup
- name: fetch Kakarot
run: make setup-kakarot
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: taiki-e/install-action@nextest
- name: run tests
run: make tests
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Heavily inspired by Reth: https://github.com/paradigmxyz/reth/blob/main/Makefile

# Include .env file to get GITHUB_TOKEN
ifneq ("$(wildcard .env)","")
include .env
endif

# The release tag of https://github.com/ethereum/tests to use for EF tests
EF_TESTS_TAG := v12.3
EF_TESTS_URL := https://github.com/ethereum/tests/archive/refs/tags/$(EF_TESTS_TAG).tar.gz
EF_TESTS_DIR := ./crates/ef-testing/ethereum-tests

# Kakarot artifacts
KKRT_ARTIFACTS_URL = $(shell curl -sL -H "Authorization: token $(GITHUB_TOKEN)" "https://api.github.com/repos/kkrt-labs/kakarot/actions/workflows/ci.yml/runs?per_page=1&branch=main&event=push&status=success" | jq -r '.workflow_runs[0].artifacts_url')
KKRT_BUILD_ARTIFACT_URL = $(shell curl -sL -H "Authorization: token $(GITHUB_TOKEN)" "$(KKRT_ARTIFACTS_URL)" | jq -r '.artifacts[] | select(.name=="kakarot-build").url')/zip

# Downloads and unpacks Ethereum Foundation tests in the `$(EF_TESTS_DIR)` directory.
# Requires `wget` and `tar`
$(EF_TESTS_DIR):
Expand All @@ -17,11 +26,14 @@ $(EF_TESTS_DIR):
.PHONY: $(EF_TESTS_DIR)
setup: $(EF_TESTS_DIR)

setup-kakarot: pull-kakarot
cd lib/kakarot && make setup && make build
setup-kakarot: clean-kakarot
@curl -sL -o kakarot-build.zip -H "Authorization: token $(GITHUB_TOKEN)" "$(KKRT_BUILD_ARTIFACT_URL)"
unzip -o kakarot-build.zip -d lib/kakarot/build
rm -f kakarot-build.zip

pull-kakarot:
git submodule update --init --recursive
clean-kakarot:
rm -rf lib/kakarot
mkdir -p lib/kakarot/build

# Runs the repo tests
tests:
Expand Down

0 comments on commit fad6e52

Please sign in to comment.