This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!--- 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 - [x] Other (please describe): ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Resolves #1394 ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Monorepo with kakarot0 and SSJ <!-- 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/1456) <!-- Reviewable:end -->
- Loading branch information
Showing
312 changed files
with
46,660 additions
and
91 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.github/workflows/release.yml → .github/workflows/cairo-zero-release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# trunk-ignore-all(checkov/CKV2_GHA_1) | ||
name: Release | ||
name: cairo-zero-Release | ||
|
||
on: | ||
release: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/update-rpc.yml → .github/workflows/cairo-zero-update-rpc.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update Submodule | ||
name: cairo-zero Update Submodule | ||
|
||
on: | ||
release: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Reusable Build Workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
artifact-name: | ||
required: true | ||
type: string | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
ssj-build: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_COMMIT_MESSAGE: CI Formatting Auto Commit | ||
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} CI | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Scarb | ||
uses: software-mansion/setup-scarb@v1 | ||
with: | ||
tool-versions: ./cairo/kakarot-ssj/.tool-versions | ||
|
||
- name: Build contracts | ||
run: cd cairo/kakarot-ssj/ && scarb build -p contracts | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: cairo/kakarot-ssj/target/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: SSJ-CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- cairo/kakarot-ssj/** | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
concurrency: | ||
group: ssj-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
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: false | ||
|
||
ssj-ef-tests: | ||
uses: ./.github/workflows/ssj-ef-tests.yml | ||
needs: [ssj-build] | ||
with: | ||
artifact-name: ssj-build | ||
|
||
ssj-resources: | ||
runs-on: ubuntu-latest | ||
needs: [ssj-ef-tests] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.10.14 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10.14 | ||
|
||
- name: Load cached Poetry installation | ||
id: cached-poetry | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry | ||
if: steps.cached-poetry.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- run: poetry config installer.modern-installation false | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: make setup | ||
|
||
- name: Load performance artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: resources | ||
name: resources | ||
|
||
- name: Check resources evolution | ||
run: | | ||
result=$(GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} make check-resources 2>&1) | ||
echo "$result" >> "$GITHUB_STEP_SUMMARY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
name: SSJ-EF-Tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
artifact-name: | ||
required: true | ||
type: string | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
ef-tests: | ||
# trunk-ignore(actionlint/runner-label) | ||
runs-on: ubuntu-latest-16-cores | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache cairo-native setup | ||
id: cache-cairo-native | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
cairo/kakarot-ssj/target/ | ||
./libcairo_native_runtime.a | ||
key: | ||
${{ runner.os }}-cairo-native-${{ hashFiles('**/Cargo.lock', | ||
'scripts/setup_cairo_native.sh') }} | ||
|
||
- name: Make setup script executable | ||
run: chmod +x ./cairo/kakarot-ssj/scripts/setup_cairo_native.sh | ||
|
||
- name: Setup Cairo Native | ||
run: | | ||
if [[ "${{ steps.cache-cairo-native.outputs.cache-hit }}" == 'true' ]]; then | ||
sudo ./cairo/kakarot-ssj/scripts/setup_cairo_native.sh -s | ||
else | ||
sudo ./cairo/kakarot-ssj/scripts/setup_cairo_native.sh | ||
fi | ||
- name: Set Environment Variables | ||
run: | | ||
echo "MLIR_SYS_190_PREFIX=/usr/lib/llvm-19/" >> $GITHUB_ENV | ||
echo "LLVM_SYS_191_PREFIX=/usr/lib/llvm-19/" >> $GITHUB_ENV | ||
echo "TABLEGEN_190_PREFIX=/usr/lib/llvm-19/" >> $GITHUB_ENV | ||
echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/libcairo_native_runtime.a" >> $GITHUB_ENV | ||
- name: Checkout ef-tests | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: kkrt-labs/ef-tests | ||
ref: feat/cairo-native | ||
path: ef-tests # Check out to a subdirectory to avoid cleaning the kakarot-ssj directory | ||
|
||
- name: Checkout local skip file | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
cairo/kakarot-ssj/ | ||
sparse-checkout-cone-mode: false | ||
path: skip-file | ||
|
||
- name: Setup ef-tests | ||
run: | | ||
mv skip-file/cairo/kakarot-ssj/blockchain-tests-skip.yml ef-tests/blockchain-tests-skip.yml | ||
cd ef-tests | ||
mkdir -p build/common | ||
make setup setup-kakarot-v0 | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
|
||
- name: Download Kakarot-SSJ build artifacts in v1 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: ef-tests/build/v1 | ||
|
||
- name: Move Cairo1Helpers | ||
run: | | ||
mv ef-tests/build/v1/contracts_Cairo1Helpers.compiled_contract_class.json \ | ||
ef-tests/build/common/cairo1_helpers.json | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10.14 | ||
|
||
# Add this step to verify the file exists | ||
- name: Verify libcairo_native_runtime.a | ||
run: | | ||
echo $CAIRO_NATIVE_RUNTIME_LIBRARY | ||
ls -l $CAIRO_NATIVE_RUNTIME_LIBRARY | ||
- name: Run tests | ||
working-directory: ef-tests | ||
run: | | ||
set -o pipefail | ||
RUST_MIN_STACK=1342177280 make ef-test-v1-native | tee test_v1.out | ||
set +o pipefail | ||
- name: Retrieve ef-tests execution resources | ||
working-directory: ef-tests | ||
run: python scripts/compute_resources.py | ||
env: | ||
KAKAROT_VERSION: v1 | ||
|
||
- name: Upload resources | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ef-tests/resources | ||
name: resources | ||
|
||
- name: Generate blockchain-tests-skip.yml file | ||
if: github.event_name == 'workflow_dispatch' | ||
working-directory: ef-tests | ||
run: make generate-skip-file | ||
|
||
- name: Upload skip file | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ef-tests/blockchain-tests-skip.yml | ||
name: blockchain-tests-skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# trunk-ignore-all(checkov/CKV2_GHA_1) | ||
name: SSJ-Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-upload: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Scarb | ||
uses: software-mansion/setup-scarb@v1 | ||
with: | ||
tool-versions: ./cairo/kakarot-ssj/.tool-versions | ||
- name: Build contracts | ||
run: | | ||
cd cairo/kakarot-ssj && scarb build -p contracts | ||
- name: Zip dev artifacts | ||
run: zip -rj kakarot-ssj-build.zip cairo/kakarot-ssj/target/dev | ||
- name: Upload artifacts to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: kakarot-ssj-build.zip | ||
asset_name: kakarot-ssj-build.zip | ||
tag: ${{ github.ref_name }} | ||
overwrite: true |
Oops, something went wrong.