-
Notifications
You must be signed in to change notification settings - Fork 28
115 lines (91 loc) · 3.25 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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
DEVNET_DUMP_PATH: /devnet-dump.json
DEVNET_DEPLOYMENT_DUMP_PATH: /tmp/devnet-deployment-dump.json
DEVNET_SET_FEES_DUMP_PATH: /tmp/devnet-set-fees-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 \
shardlabs/starknet-devnet-rs:${STARKNET_DEVNET_VERSION} \
--seed 0 --dump-path $DEVNET_DUMP_PATH --dump-on exit --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: Store devnet state after contract deployment
run: |
curl -H "Content-type: application/json" \
-X POST http://localhost:5050/dump \
-d '{"path": "$DEVNET_DEPLOYMENT_DUMP_PATH"}'
- name: Setup environment
run: cp .env.devnet .env
- name: Run set Ark fees test
run: pnpm test --filter=core -- tests/setArkFees.test.ts
- name: Store devnet state after set ark fees
run: |
curl -H "Content-type: application/json" \
-X POST http://localhost:5050/dump \
-d '{"path": "$DEVNET_SET_FEES_DUMP_PATH"}'
- name: Run fulfill auction test
run: |
pnpm test --filter=core -- tests/fulfillAuction.test.ts
- name: Restore devnet state
run: |
curl -H "Content-type: application/json" \
-X POST http://localhost:5050/load \
-d '{"path": "$DEVNET_SET_FEES_DUMP_PATH"}'
- name: Run SDK test
run: |
pnpm test --filter=core
- name: Stop starknet-devnet container
if: always()
run: docker stop starknet-devnet