Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sgc-code committed Feb 5, 2024
2 parents 4070f39 + 8d84b9f commit ff4e600
Show file tree
Hide file tree
Showing 148 changed files with 200,136 additions and 2,855 deletions.
1 change: 1 addition & 0 deletions .cairofmtignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
starknet-devnet-rs
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BASE_URL=https://alpha4.starknet.io/
RPC_URL=http://127.0.0.1:5050
ADDRESS=0x000000000000000000000000000000000000000000000000000000000000000
PRIVATE_KEY=0x000000000000000000000000000000000000000000000000000000000000000
52 changes: 9 additions & 43 deletions .github/workflows/cairo-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Cairo CI

env:
ARCHIVE_LINK: https://github.com/starkware-libs/cairo/releases/download/v2.0.0/release-x86_64-unknown-linux-musl.tar.gz
ARCHIVE_NAME: cairo.zip

on: push

jobs:
Expand All @@ -12,47 +8,17 @@ jobs:
steps:
- name: Step 1 - Check out main branch
uses: actions/checkout@v3

- name: Step 2 - Downloading binaries
run: curl -L -o $ARCHIVE_NAME $ARCHIVE_LINK

- name: Step 3 - Unzipping binaries
run: tar -xvf $ARCHIVE_NAME

- name: Step 4 - Make binaries available
run: echo "./cairo/bin" >> $GITHUB_PATH

- name: Step 5 - Run all tests
run: cairo-test --starknet ./contracts

- name: Step 2 - Getting scarb
uses: software-mansion/[email protected]
- name: Step 3 - Testing
run: scarb test

format:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Check out main branch
uses: actions/checkout@v3

- name: Step 2 - Downloading binaries
run: curl -L -o $ARCHIVE_NAME $ARCHIVE_LINK

- name: Step 3 - Unzipping binaries
run: tar -xvf $ARCHIVE_NAME

- name: Step 4 - Make binaries available
run: echo "./cairo/bin" >> $GITHUB_PATH

- name: Step 5 - Check formatting
run: cairo-format --check --recursive ./contracts

contract-approvers:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Check out main branch
uses: actions/checkout@v3

- name: Step 2 - Install project
run: yarn install --frozen-lockfile

- name: Step 3 - Check approvers count
run: yarn ts-node ./scripts/check-contract-approvers.ts 3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Step 2 - Getting scarb
uses: software-mansion/[email protected]
- name: Step 3 - Checking format
run: scarb fmt --check
60 changes: 30 additions & 30 deletions .github/workflows/integration-ci.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
name: Integration CI

env:
ARCHIVE_LINK: https://github.com/starkware-libs/cairo/releases/download/v2.0.0/release-x86_64-unknown-linux-musl.tar.gz
ARCHIVE_NAME: cairo_binaries.zip

on: push

jobs:
tests:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Check out main branch
- name: Check out main branch
uses: actions/checkout@v3

- name: Step 2 - Install correct python version
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"

- name: Step 3 - Cloning repo
run: make clone-cairo
- name: Setup Scarb
uses: software-mansion/[email protected]

- name: Install project
run: yarn install --frozen-lockfile

- name: Step 4 - Downloading binaries, unzipping them and making them available
working-directory: ./cairo
- name: Start devnet in background
run: |
curl -L -o $ARCHIVE_NAME $ARCHIVE_LINK
tar -xvf $ARCHIVE_NAME
mkdir -p target/release
mv cairo/bin/* target/release
scarb run start-devnet &
./scripts/wait-devnet-ready.sh
- name: Run integration tests
run: scarb --release build && tsc && yarn mocha tests-integration/*.test.ts --forbid-only --forbid-pending

- name: Step 5 - Installing requirements
run: pip3 install -r requirements.txt
gas-report:
runs-on: ubuntu-latest
steps:
- name: Check out main branch
uses: actions/checkout@v3

- name: Step 6 - Start devnet in background
- name: Setup Scarb
uses: software-mansion/[email protected]

- name: Install project
run: yarn install --frozen-lockfile

- name: Start devnet in background
run: |
make devnet &
scarb run start-devnet &
./scripts/wait-devnet-ready.sh
- name: Step 7 - Run integrations tests
run: |
yarn install --frozen-lockfile
make test-integration
- name: Gas report
run: scarb run profile --check

format:
runs-on: ubuntu-latest
Expand All @@ -53,7 +53,7 @@ jobs:
run: yarn install --frozen-lockfile

- name: Step 3 - Check correct formatting
run: yarn format:check
run: yarn prettier --check .

lint:
runs-on: ubuntu-latest
Expand All @@ -65,4 +65,4 @@ jobs:
run: yarn install --frozen-lockfile

- name: Step 3 - Check correct linting
run: yarn lint:check
run: yarn eslint .
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.env
.env.*
!.env.example
.idea
.vscode
.DS_Store
Expand All @@ -7,18 +9,13 @@ venv
.pytest_cache
__pycache__
artifacts
!deployments/artifacts
dist
target
node_modules
node.json

cairo
account.json
tests/fixtures/ArgentAccount.json
tests/fixtures/ArgentAccount.casm
tests/fixtures/ArgentMultisig.json
tests/fixtures/ArgentMultisig.casm
tests/fixtures/TestDapp.json
tests/fixtures/TestDapp.casm
dump
package-lock.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
7 changes: 5 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
cairo
contracts
venv
tests/fixtures
target
deployments/artifacts
dist
.github
tests-integration/fixtures
starknet-devnet-rs
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 2.4.3
93 changes: 0 additions & 93 deletions Makefile

This file was deleted.

Loading

0 comments on commit ff4e600

Please sign in to comment.