Skip to content

Commit

Permalink
finalize (#21)
Browse files Browse the repository at this point in the history
* add CI for cairo
  • Loading branch information
notV4l authored Oct 16, 2024
1 parent dcc24fb commit a703ac9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: ci
on: push
env:
CARGO_TERM_COLOR: always
SCARB_VERSION: 2.7.0
jobs:
fmt:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,3 +41,39 @@ jobs:
- name: Run tests
working-directory: ./server
run: cargo test --workspace --verbose

check-cairo:
runs-on: ubuntu-latest
name: Check cartridge-vrf format
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- name: Format
run: scarb fmt --check

build-cairo:
needs: check-cairo
runs-on: ubuntu-latest
name: Build cartridge-vrf
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- name: Build
run: scarb build

test-cairo:
needs: [check-cairo, build-cairo]
runs-on: ubuntu-latest
name: Test cartridge-vrf
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- uses: foundry-rs/setup-snfoundry@v3
- name: Test
run: snforge test
1 change: 0 additions & 1 deletion src/mocks/vrf_consumer_mock.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#[starknet::interface]
trait IVrfConsumerMock<TContractState> {
fn dice(ref self: TContractState) -> u8;
Expand Down
3 changes: 1 addition & 2 deletions src/tests/common.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use cartridge_vrf::vrf_provider::vrf_provider_component::{
};

use cartridge_vrf::mocks::vrf_consumer_mock::{
VrfConsumer, IVrfConsumerMock, IVrfConsumerMockDispatcher,
IVrfConsumerMockDispatcherTrait
VrfConsumer, IVrfConsumerMock, IVrfConsumerMockDispatcher, IVrfConsumerMockDispatcherTrait
};

pub fn PROVIDER() -> ContractAddress {
Expand Down
3 changes: 1 addition & 2 deletions src/tests/test_dice.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use cartridge_vrf::{
};

use cartridge_vrf::mocks::vrf_consumer_mock::{
VrfConsumer, IVrfConsumerMock, IVrfConsumerMockDispatcher,
IVrfConsumerMockDispatcherTrait
VrfConsumer, IVrfConsumerMock, IVrfConsumerMockDispatcher, IVrfConsumerMockDispatcherTrait
};

use super::common::{setup, submit_random, SetupResult, CONSUMER1, CONSUMER2, PLAYER1};
Expand Down

0 comments on commit a703ac9

Please sign in to comment.