-
Notifications
You must be signed in to change notification settings - Fork 7
140 lines (119 loc) · 3.98 KB
/
Copy pathtypescript-ci.yml
File metadata and controls
140 lines (119 loc) · 3.98 KB
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
name: TypeScript CI
on:
pull_request:
push:
branches: [main]
jobs:
lint:
name: SDK Lint & Format
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
sdk:
- 'sdk/**'
- uses: actions/setup-node@v4
if: steps.filter.outputs.sdk == 'true'
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: sdk/package-lock.json
- if: steps.filter.outputs.sdk == 'true'
run: npm ci && npm run lint
check:
name: SDK Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: sdk/package-lock.json
- name: Install npm dependencies
run: npm ci
- name: Install Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.17.0"
- uses: software-mansion/setup-universal-sierra-compiler@v1
with:
universal-sierra-compiler-version: "v2.8.0"
- name: Install starknet-foundry via asdf
uses: asdf-vm/actions/install@v3
with:
asdf_branch: v0.14.1
tool_versions: |
starknet-foundry 0.59.0
- name: Regenerate Cairo contract artifacts
run: npm run generate
- name: Fetch proving API spec
env:
SEQUENCER_SPEC_REF: "avi/privacy/add-rpc-spec"
run: npm run fetch:proving-spec
- name: Run tests
run: npm run test:fast
devnet:
name: SDK Devnet Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
# fetch-depth: 2 so paths-filter can diff against the parent commit on push events (on
# pull_request it uses the GitHub API and needs no history).
- uses: actions/checkout@v4
with:
fetch-depth: 2
# The devnet suite exercises the SDK against the Cairo contracts, so run it only when the SDK, the
# contracts, or this workflow itself change (the last so a change to the job below is exercised by
# its own PR). Client-only PRs skip it (the steps no-op and the job still reports green, keeping a
# required check satisfied) rather than being gated on the unrelated Cairo/devnet build.
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
devnet:
- 'sdk/**'
- 'packages/**'
- 'Scarb.toml'
- 'Scarb.lock'
- '.github/workflows/typescript-ci.yml'
- uses: actions/setup-node@v4
if: steps.filter.outputs.devnet == 'true'
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: sdk/package-lock.json
- name: Install Scarb
if: steps.filter.outputs.devnet == 'true'
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.17.0"
- uses: software-mansion/setup-universal-sierra-compiler@v1
if: steps.filter.outputs.devnet == 'true'
with:
universal-sierra-compiler-version: "v2.8.0"
- name: Install starknet-devnet
if: steps.filter.outputs.devnet == 'true'
run: |
curl -L https://github.com/0xSpaceShard/starknet-devnet/releases/download/v0.8.0-rc.3/starknet-devnet-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C /usr/local/bin
chmod +x /usr/local/bin/starknet-devnet
- name: Install npm dependencies
if: steps.filter.outputs.devnet == 'true'
run: npm ci
- name: Build Cairo contracts
if: steps.filter.outputs.devnet == 'true'
run: npm run scarb:build
- name: Run devnet tests
if: steps.filter.outputs.devnet == 'true'
run: npm run test:devnet