forked from focustree/starknet.dart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmelos.yaml
145 lines (128 loc) · 4.44 KB
/
melos.yaml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: monorepo
repository: https://github.com/focustree/starknet.dart
packages:
- examples/**
- packages/**
- contracts/v$CAIRO_VERSION/**
ignore:
command:
bootstrap:
runPubGetInParallel: true
version:
linkToCommits: true
workspaceChangelog: true
scripts:
validate-gh-actions:
run: |
action-validator .github/workflows/ci.yaml
analyze:
description: Analyze all packages
exec: dart analyze --fatal-infos
format:
run: |
dart pub global run flutter_plugin_tools format && swiftformat .
description: |
Formats the code of all packages (Java, Objective-C, and Dart).
- Requires `flutter_plugin_tools` (`pub global activate flutter_plugin_tools`).
- Requires `git`.
- Requires `clang-format` (can be installed via Brew on MacOS).
- Requires `swiftformat` (can be installed via Brew on macOS).
format:check:
description: Format check all packages
exec: dart format --set-exit-if-changed .
starknet:setup:
description: Install starknet dev env
run: |
asdf plugin add starknet-devnet
asdf install starknet-devnet $STARKNET_DEVNET_VERSION
asdf local starknet-devnet $STARKNET_DEVNET_VERSION
asdf plugin add scarb
asdf install scarb $SCARB_VERSION
asdf local scarb $SCARB_VERSION
asdf plugin add starkli
asdf install starkli $STARKLI_VERSION
asdf local starkli $STARKLI_VERSION
asdf plugin add action-validator
asdf install action-validator latest
melos versions
versions:
description: Display toolchain versions
run: |
echo "starkli: $(starkli --version)"
scarb --version
starknet-devnet --version
devnet:start:
description: Start local devnet
run: |
starknet-devnet --seed 0 --dump-path $DEVNET_DUMP_PATH --state-archive-capacity full --port 5050
devnet:start:dump:
description: Start local devnet from scratch and dump on exit
run: |
rm $DEVNET_DUMP_PATH
starknet-devnet --seed 0 --dump-path $DEVNET_DUMP_PATH --state-archive-capacity full --dump-on exit --port 5050
devnet:setup:
description: Setup local devnet
run: |
melos contracts:build
melos contracts:declare
melos contracts:deploy
melos contracts:invoke
contracts:build:
description: Build cairo contracts
run: |
cd contracts/v$CAIRO_VERSION
scarb build
contracts:declare:
description: Declare cairo contracts
run: |
starkli declare contracts/v$CAIRO_VERSION/target/dev/starknet_dart_hello.contract_class.json --compiler-version $CAIRO_VERSION
contracts:deploy:
description: Deploy cairo contracts
run: |
starkli deploy $HELLO_CLASS_HASH --salt $SALT 0x0
contracts:check:
description: Check cairo contracts
run: |
cd contracts/v$CAIRO_VERSION
asdf install scarb $SCARB_VERSION
scarb check
contracts:invoke:
description: creating invoke tx for tests with hash 0x03b2911796e0024f9e23d7337997538058eca267d5ddaa582d482cbe1fb64897 and deploy_account tx with hash 0x055ba13c33a12506d2eab8dfbc618a8ce0d247c24959a64ee18fbf393c873b83
run: |
starkli invoke $HELLO_CONTRACT_ADDRESS set_name 0x0
# should create tx hash 0x029583643cd8932f1955bf28bfebf4c907b13df1e5c2d202b133cfbf783697a2
cp -f .starkli/account_for_devnet_setup.json .starkli/account_1.json
starkli invoke eth transfer 0x016a0d7df981d681537dc2ce648722ff1d1c2cbe59412b492d35bac69825f104 0x100000000000000000 0x0
echo | starkli account deploy .starkli/account_1.json
test:
description: Run all tests
steps:
- melos test:dart:unit
- melos test:dart:integration
test:dart:unit:
description: Run all dart unit tests
run: melos exec --dir-exists="test" -- dart test --tags unit --fail-fast
packageFilters:
ignore: "*starknet_builder*"
flutter: false
test:dart:integration:
description: Run all dart integration tests
run: melos exec -c 1 --dir-exists="test" -- dart test --tags integration --fail-fast
packageFilters:
ignore: "*starknet_builder*"
flutter: false
publish:dry-run:
description: Publish dry-run all packages
exec: dart pub publish --dry-run
packageFilters:
noPrivate: true
upgrade:dart:
name: Upgrade Dart package deps
exec: dart pub upgrade
packageFilters:
flutter: false
upgrade:flutter:
name: Upgrade Flutter package deps
exec: flutter pub upgrade
packageFilters:
flutter: true