-
Notifications
You must be signed in to change notification settings - Fork 26
86 lines (68 loc) · 2.17 KB
/
arkproject-contracts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: ArkProject contracts ci
on:
push:
branches:
- main
paths:
- "contracts/**"
pull_request:
paths:
- "contracts/**"
env:
SCARB_VERSION: 2.7.1
STARKNET_DEVNET_VERSION: 0.2.0-rc3
DEVNET_DUMP_PATH: /devnet-dump.json
jobs:
fmt:
runs-on: ubuntu-latest
name: Cairo formatting
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- name: Check Scarb Formatting
run: cd contracts && scarb fmt --check
forge-test:
runs-on: ubuntu-latest
name: Cairo starknet foundry tests
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install starknet foundry & dependencies
uses: ./.github/actions/install-snforge
- name: Test contracts
run: cd contracts && snforge test
devnet-test:
runs-on: ubuntu-latest
name: Running SDK test with starknet-devnet
# needs: forge-test
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install starknet foundry & dependencies
uses: ./.github/actions/install-snforge
- name: Build smart contracts
run: cd contracts && scarb build --workspace
- name: Run starknet-devnet as a background process
run: |
docker run -d --rm --name starknet-devnet \
-p 5050:5050 \
ptisserand/starknet-devnet-rs:${STARKNET_DEVNET_VERSION} \
--seed 0 --dump-path $DEVNET_DUMP_PATH --state-archive-capacity full
sleep 3 # Wait for 3 seconds for the Docker container to initialize
- name: Install SDK dependencies
uses: ./.github/actions/install-dependencies
- name: Setup environment for devnet
run: cp .env.devnet .env
- name: Deploy smart contract
run: pnpm deploy:starknet:local
- name: Run SDK test
run: |
cp .env.devnet .env
pnpm test
- name: Stop starknet-devnet container
if: always()
run: docker stop starknet-devnet