-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.yml
89 lines (87 loc) · 3.44 KB
/
config.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
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference
version: 2.1
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/configuration-reference/#jobs
jobs:
build-and-test:
machine:
image: ubuntu-2204:2024.01.2
resource_class: xlarge
environment:
DEVNET_VERSION: "0.2.2"
DEVNET_DIR: "/tmp/devnet-ci-storage"
# to avoid definition complications, when updating DEVNET_DIR, always update DEVNET_PATH (should be prefix)
DEVNET_PATH: "/tmp/devnet-ci-storage/starknet-devnet"
FORKED_DEVNET_PORT: 5051
steps:
- checkout
- run:
name: Versions
command: |
echo "node: $(node --version)"
echo "npm: $(npm --version)"
- run:
name: Install
command: npm ci
- run:
name: Build
command: npm run build
- run:
name: Format
command: npm run format-check
- run:
name: Lint
command: npm run lint-check
- run:
name: Check all tests executed
command: npm run check-all-tests-executed
- run:
name: Spawn Devnet
command: |
docker run -d --network host --name devnet \
shardlabs/starknet-devnet-rs:${DEVNET_VERSION} --state-archive-capacity full --dump-on request
- run:
name: Spawn Devnet forked from Mainnet
command: |
docker run -d --network host --name forked-devnet \
shardlabs/starknet-devnet-rs:${DEVNET_VERSION} --port ${FORKED_DEVNET_PORT} --fork-network http://rpc.pathfinder.equilibrium.co/mainnet/rpc/v0_7
- run:
name: Download precompiled Devnet
command: |
URL=https://github.com/0xSpaceShard/starknet-devnet-rs/releases/download/v${DEVNET_VERSION}/starknet-devnet-x86_64-unknown-linux-gnu.tar.gz
mkdir -p ${DEVNET_DIR}
curl -sSfL ${URL} | tar -xvz -C ${DEVNET_DIR}
- run:
name: Spawn Anvil
command: |
docker run -d --network host --name anvil \
ghcr.io/foundry-rs/foundry:nightly-5b7e4cb3c882b28f3c32ba580de27ce7381f415a anvil
- run:
name: Test
command: npm run test
- run:
name: Test keepAlive
command: ./scripts/test-keep-alive.sh
publish:
docker:
- image: cimg/node:20.10.0
steps:
- checkout
- run:
name: Publish
command: ./scripts/npm-publish.sh
# Orchestrate jobs using workflows
# See: https://circleci.com/docs/configuration-reference/#workflows
workflows:
build-test-maybe-publish:
jobs:
- build-and-test
- publish:
context: spaceshard
filters:
branches:
only:
- master
requires:
- build-and-test