Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Add trunk (#748)
Browse files Browse the repository at this point in the history
Time spent on this PR: 0.4

## Pull request type

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [x] 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?

Miscellaneous linter configurations and tools.

## What is the new behavior?

Use [trunk](https://docs.trunk.io)
  • Loading branch information
ClementWalter authored Sep 19, 2023
1 parent aec81a4 commit ad0cc45
Show file tree
Hide file tree
Showing 56 changed files with 49,551 additions and 49,514 deletions.
26 changes: 15 additions & 11 deletions .github/ISSUE_TEMPLATE/01_BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,36 @@ labels: "bug"
assignees: ""
---

# Bug Report
## Bug Report

**Kakarot version:**
### Kakarot version

<!-- Please specify commit or tag version. -->

**Current behavior:**
### Current behavior

<!-- Describe how the bug manifests. -->

**Expected behavior:**
### Expected behavior

<!-- Describe what the behavior would be without the bug. -->

**Steps to reproduce:**
### Steps to reproduce

<!-- Please explain the steps required to duplicate the issue, especially if you are able to provide a sample application. -->
<!-- Please explain the steps required to duplicate the issue,
especially if you are able to provide a sample application. -->

**Related code:**
### Related code

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->
<!-- If you are able to illustrate the bug or feature request
with an example, please provide it here. -->

```
```sh
insert short code snippets here
```

**Other information:**
### Other information

<!-- List any other information that is relevant to your issue. Related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
<!-- List any other information that is relevant to your issue.
Related issues, suggestions on how to fix, Stack Overflow links,
forum links, etc. -->
30 changes: 18 additions & 12 deletions .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,33 @@ labels: "enhancement"
assignees: ""
---

# Feature Request
## Feature Request

**Describe the Feature Request**
### Describe the Feature Request

<!-- A clear and concise description of what the feature request is. Please include if your feature request is related to a problem. -->
<!-- A clear and concise description of what the feature request is.
Please include if your feature request is related to a problem. -->

**Describe Preferred Solution**
### Describe Preferred Solution

<!-- A clear and concise description of what you want to happen. -->

**Describe Alternatives**
### Describe Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered. -->
<!-- A clear and concise description of any alternative solutions or
features you've considered. -->

**Related Code**
### Related Code

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->
<!-- If you are able to illustrate the bug or feature request with an
example, please provide it here. -->

**Additional Context**
### Additional Context

<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to add, use case, Stack Overflow links, forum links, screenshots, OS if applicable, etc. -->
<!-- List any other information that is relevant to your issue. Stack traces,
related issues, suggestions on how to add, use case, Stack Overflow links,
forum links, screenshots, OS if applicable, etc. -->

**If the feature request is approved, would you be willing to submit a PR?**
Yes / No _(Help can be provided if you need assistance submitting a PR)_
### If the feature request is approved, would you be willing to submit a PR? Yes

/ No _(Help can be provided if you need assistance submitting a PR)_
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
name: Codebase improvement
about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc.
about:
Provide your feedback for the existing codebase. Suggest a better solution for
algorithms, development tools, etc.
title: "dev: "
labels: "enhancement"
assignees: ""
Expand Down
9 changes: 6 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<!--- 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? -->
<!-- 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 try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

Expand All @@ -20,7 +22,8 @@ Please check the type of change your PR introduces:

## What is the current behavior?

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

Resolves #<Issue number>

Expand Down
3 changes: 3 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
labels:
- ubuntu-latest-16-cores
26 changes: 9 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: CI

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest
env:
CI_COMMIT_MESSAGE: CI Formatting Auto Commit
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} CI
Expand Down Expand Up @@ -40,22 +46,8 @@ jobs:
run: make setup

# Build artifacts
- name: Event name
run: echo "github.event_name=${{ github.event_name }}"
- name: Format all the cairo files
run: make format
- name: Commit changes
# Run on push events and commit only when there are changes, otherwise it continues
if: github.event_name == 'push'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "[email protected]"
git add -A
git diff-index --quiet HEAD || (git commit -m "${{ env.CI_COMMIT_MESSAGE }}" && git push)
- name: Compile all the cairo files
run: |
make format-check
make build
run: make build

tests:
runs-on: ubuntu-latest-16-cores
Expand Down Expand Up @@ -118,7 +110,7 @@ jobs:
name: coverage

resources:
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Deployments
on:
push:
branches:
- "main"
- main

permissions: read-all

jobs:
deploy:
Expand All @@ -20,15 +22,15 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9.13"
python-version: 3.9.13
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-${{ runner.os }}
- name: Install Poetry
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
Expand All @@ -44,10 +46,9 @@ jobs:
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: make setup

- name: Deploy
run: |
STARKNET_NETWORK=${{ matrix.network }} poetry run python ./scripts/compile_kakarot.py
STARKNET_NETWORK=${{ matrix.network }} poetry run python ./scripts/deploy_kakarot.py
run: STARKNET_NETWORK=${{ matrix.network }} make deploy
- name: Store deployment artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
120 changes: 61 additions & 59 deletions .github/workflows/dump_katana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,68 @@ name: dump-katana
on:
push:
branches:
- "main"
- main

permissions: read-all

jobs:
dump-katana:
runs-on: ubuntu-latest-16-cores
env:
STARKNET_NETWORK: katana
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-${{ runner.os }}
- 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@v3
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: Setup Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
- name: Retrieve cached dependencies
uses: Swatinem/rust-cache@v2
- name: Install Katana
run: make install-katana
dump-katana:
runs-on: ubuntu-latest
env:
STARKNET_NETWORK: katana
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-${{ runner.os }}
- 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@v3
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: Setup Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
- name: Retrieve cached dependencies
uses: Swatinem/rust-cache@v2
- name: Install Katana
run: make install-katana

## create dump
- name: create katana dump
run: |
cp .env.example .env
make run-katana-with-dump & (make deploy && kill -2 $(lsof -t -i :5050))
## create dump
- name: create katana dump
run: |
cp .env.example .env
make run-katana-with-dump & (make deploy && kill -2 $(lsof -t -i :5050))
## upload artifacts
- name: upload kakarot on katana dump
uses: actions/upload-artifact@v3
with:
path: ./kakarot-katana-dump
name: kakarot-katana-dump
- name: upload kakarot on katana deployments
uses: actions/upload-artifact@v3
with:
path: ./deployments/katana
name: katana-deployments
## upload artifacts
- name: upload kakarot on katana dump
uses: actions/upload-artifact@v3
with:
path: ./kakarot-katana-dump
name: kakarot-katana-dump
- name: upload kakarot on katana deployments
uses: actions/upload-artifact@v3
with:
path: ./deployments/katana
name: katana-deployments
15 changes: 0 additions & 15 deletions .github/workflows/spell_check.yml

This file was deleted.

Loading

0 comments on commit ad0cc45

Please sign in to comment.