Skip to content

Commit

Permalink
feat: init repo
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienCoutant committed Dec 1, 2023
0 parents commit dff11ad
Show file tree
Hide file tree
Showing 15 changed files with 1,066 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/01_BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug Report
about: Create a report to help Shisui to improve
title: "bug: "
labels: "bug"
assignees: ""
---

# Bug Report

**Shisui version:**

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

**Current behavior:**

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

**Expected behavior:**

<!-- Describe what you expect the behavior to be without the bug. -->

**Steps to reproduce:**

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

**Related code:**

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

```
insert short code snippets here
```

**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. -->
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "feat: "
labels: "enhancement"
assignees: ""
---

# 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. -->

**Describe Preferred Solution**

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

**Describe Alternatives**

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

**Related Code**

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

**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. -->

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

<!-- Yes or No -->
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Codebase improvement
about:
Provide your feedback for the existing codebase. Suggest a better solution for
algorithms, development tools, etc.
title: "dev: "
labels: "enhancement"
assignees: ""
---
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--- Please provide a general summary of your changes in the title above -->

# Pull Request type

<!-- Please try to limit your pull request to one type; submit multiple pull requests if needed. -->

Please add the labels corresponding to the type of changes your PR introduces:

- Bugfix
- Feature
- Code style update (formatting, renaming)
- Refactoring (no functional changes, no API changes)
- Build-related changes
- Documentation content changes
- Testing
- Other (please describe):

## What is the current behavior?

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

Resolves: #NA

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by this PR. -->

-
-
-

## Does this introduce a breaking change?

<!-- Yes or No -->
<!-- If this does introduce a breaking change, please describe the impact and migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR, such as screenshots of how the component looks before and after the change. -->
43 changes: 43 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Shisui Book

on:
push:
branches:
- main

jobs:
book:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2

- name: Check for changes in the book directory
id: check_changes
run: |
if git diff --quiet --exit-code HEAD^ HEAD -- book; then
echo "No changes in the 'book' directory. Exiting..."
exit 0
else
echo "Changes detected in the book directory. Continuing..."
fi
continue-on-error: true

- name: Setup mdBook
if: steps.check_changes.outcome == 'success'
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"

- name: Build mdBook
if: steps.check_changes.outcome == 'success'
run: mdbook build
working-directory: ./book

- name: Deploy
if: ${{ github.ref == 'refs/heads/main' }} && steps.check_changes.outcome == 'success'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on: [push, pull_request]

env:
SCARB_VERSION: 0.7.0

# For the moment we will use nightly versions of scarb to be able to use latest features of Cairo.
# The installation process will be a bit different than when using non nightly versions.
# Once Cairo and Scarb will be stable, we will use the stable versions and the `software-mansion/setup-scarb` action.
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "0.7.0"
# - name: Set up Scarb
#ses: software-mansion/setup-scarb@v1
# Install Scarb from a nightly release
# run: |
# NIGHTLY_DATE=$(echo ${SCARB_VERSION} | cut -d '+' -f 2)
# wget https://github.com/software-mansion/scarb-nightlies/releases/download/${NIGHTLY_DATE}/scarb-${NIGHTLY_DATE}-x86_64-unknown-linux-gnu.tar.gz
# tar -xvf scarb-${NIGHTLY_DATE}-x86_64-unknown-linux-gnu.tar.gz
# sudo mv scarb-v${SCARB_VERSION}-x86_64-unknown-linux-gnu/bin/scarb /usr/local/bin
- name: Check cairo format
run: scarb fmt --check
- name: Build cairo programs
run: scarb build
50 changes: 50 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Security

on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "0.7.0"

- name: Install Semgrep
run: |
pip install semgrep
- name: Run Semgrep
run: semgrep --config https://github.com/avnu-labs/semgrep-cairo-rules/releases/download/v0.0.1/cairo-rules.yaml ./src > semgrep-output.txt
- name: Save Semgrep Output as an Artifact
uses: actions/upload-artifact@v3
with:
name: semgrep-cairo
path: semgrep-output.txt

- name: Build cairo programs
run: scarb build

- name: Cache Cargo dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Check if Caracal is installed
id: check-caracal
run: |
if ! command -v caracal &> /dev/null; then
echo "Caracal is not installed. Installing..."
cargo install --git https://github.com/crytic/caracal --profile release --force
else
echo "Caracal is already installed."
fi
- name: Run Caracal
run: caracal detect . > caracal-output.txt
- name: Save Caracal Output as an Artifact
uses: actions/upload-artifact@v3
with:
name: caracal-cairo
path: caracal-output.txt
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on: [push, pull_request]

env:
SCARB_VERSION: 0.7.0
STARKNET_FOUNDRY_VERSION: 0.6.0

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "0.7.0"
# - name: Set up Scarb
#ses: software-mansion/setup-scarb@v1
# Install Scarb from a nightly release
# run: |
# NIGHTLY_DATE=$(echo ${SCARB_VERSION} | cut -d '+' -f 2)
# wget https://github.com/software-mansion/scarb-nightlies/releases/download/${NIGHTLY_DATE}/scarb-${NIGHTLY_DATE}-x86_64-unknown-linux-gnu.tar.gz
# tar -xvf scarb-${NIGHTLY_DATE}-x86_64-unknown-linux-gnu.tar.gz
# sudo mv scarb-v${SCARB_VERSION}-x86_64-unknown-linux-gnu/bin/scarb /usr/local/bin
- name: Install starknet foundry
run: curl -L https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/install.sh | sh -s -- -v ${STARKNET_FOUNDRY_VERSION}
- name: Run cairo tests
run: snforge
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
.snfoundry_cache/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

**/.DS_Store
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 2.3.1
Loading

0 comments on commit dff11ad

Please sign in to comment.