Skip to content

Commit

Permalink
added CI workflows for build + test (Flex-NFT-Marketplace#17)
Browse files Browse the repository at this point in the history
LGTM!
  • Loading branch information
ametel01 authored Dec 21, 2023
1 parent 82c105a commit 76ce82b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on: [push, pull_request]

env:
SCARB_VERSION: 2.4.0

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- name: Check cairo format
run: |
cd flex_marketplace
scarb fmt --check
- name: Build cairo programs
run: |
cd flex_marketplace
scarb build
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on: [push, pull_request]

env:
SCARB_VERSION: 2.4.0
SNFORGE_VERSION: 0.13.0

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- uses: foundry-rs/setup-snfoundry@v2
with:
starknet-foundry-version: ${{ env.SNFORGE_VERSION }}
- name: Run cairo tests
run: |
cd flex_marketplace
snforge test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

flex_marketplace/target/

flex_marketplace/.snfoundry_cache/
2 changes: 1 addition & 1 deletion flex_marketplace/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ source = "git+https://github.com/openzeppelin/cairo-contracts?tag=v0.8.0#c23e8e9
[[package]]
name = "snforge_std"
version = "0.1.0"
source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.11.0#5465c41541c44a7804d16318fab45a2f0ccec9e7"
source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.13.0#99c2f9d33159988efd339bd969c78d82b0b4b6f7"
11 changes: 7 additions & 4 deletions flex_marketplace/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[package]
name = "flex"
version = "0.1.0"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
edition = "2023_01"

[dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.11.0" }
openzeppelin = { git = "https://github.com/openzeppelin/cairo-contracts", tag = "v0.8.0" }
starknet = "2.4.0"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.13.0" }
openzeppelin = { git = "https://github.com/openzeppelin/cairo-contracts", tag = "v0.8.0" }

[scripts]
test = "snforge test"
2 changes: 1 addition & 1 deletion flex_marketplace/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod marketplace {
mod launchpad {
mod ERC721_launchpad_migrated;
mod ERC721_Launchpad;
mod ERC721_launchpad;
mod minter;
}

Expand Down
4 changes: 2 additions & 2 deletions flex_marketplace/src/marketplace/market_place.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,12 @@ mod MarketPlace {
fn calculate_protocol_fee(
self: @ContractState, execution_strategy: felt252, amount: u128
) -> u128 { // TODO
0
0
}

fn validate_order(
self: @ContractState, order: MakerOrder, order_signature: Span<felt252>
) {// TODO
) { // TODO
}
}
}

0 comments on commit 76ce82b

Please sign in to comment.