Skip to content

Commit

Permalink
first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Aug 7, 2023
1 parent 5b75567 commit e0d1cd1
Show file tree
Hide file tree
Showing 11 changed files with 309 additions and 336 deletions.
48 changes: 19 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
name: Cairo-tests

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

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Check out main branch
uses: actions/checkout@v3
- name: Step 2 - Getting scarb
uses: software-mansion/setup-scarb@v1
- name: Step 3 - Trying to build
run: scarb build

tests:
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 - Run all tests
run: cairo-test --starknet .

- name: Step 2 - Getting scarb
uses: software-mansion/setup-scarb@v1
- name: Step 3 - Testing
run: scarb build
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 - Run formatter check
run: cairo-format --recursive --check .
- name: Step 2 - Getting scarb
uses: software-mansion/setup-scarb@v1
- name: Step 3 - Checkign format
run: scarb fmt --check

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 0.6.0
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ This is the same as written by OpenZeppelin with some adjustemnts:

## 🌡️ Tests

*Prerequisite: Having cairo installed https://github.com/starkware-libs/cairo/*
*Prerequisite: Having asdf scarb installed https://docs.swmansion.com/scarb/download#install-via-asdf*
Clone this repo and move in that repo:
```shell
git clone https://github.com/gaetbout/starknet-erc20-lazy-initialization
cd starknet-erc20-lazy-initialization
cairo-test --starknet .
git clone https://github.com/gaetbout/starknet-erc20-lazy-initialization && cd starknet-erc20-lazy-initialization
scarb test
```
For more details check the Actions tab of this GitHub repository.

Expand Down
9 changes: 9 additions & 0 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "lazy"
version = "0.1.0"

[[target.starknet-contract]]
sierra = true

[dependencies]
starknet = "=2.1.0"
2 changes: 0 additions & 2 deletions cairo_project.toml

This file was deleted.

Loading

0 comments on commit e0d1cd1

Please sign in to comment.