-
Notifications
You must be signed in to change notification settings - Fork 17
153 lines (119 loc) · 3.76 KB
/
unit-tests.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
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
146
147
148
149
150
151
152
153
name: Unit Tests
on: [push]
jobs:
start-spot-vm:
name: Start Spot VM
runs-on: ubuntu-latest
steps:
- name: Authenticate with GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- name: Start Spot VM
run: gcloud compute instances start email-tx-builder-runner-spot --zone=us-central1-c
- name: Wait for Spot VM to initialize
run: |
echo "Waiting for Spot VM to initialize..."
sleep 60
circuits:
name: circuits
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install unzip
run: sudo apt-get install -y unzip
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Create bin directory
run: mkdir -p $HOME/bin
- name: Download circom v2.1.9 (Linux)
run: |
wget https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64 -O $HOME/bin/circom
chmod +x $HOME/bin/circom
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
- name: Print circom version
run: circom --version
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
working-directory: packages/circuits
run: yarn test --maxWorkers=75% --no-cache
contracts:
name: contracts
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/[email protected]
with:
version: nightly-0079a1146b79a4aeda58b0258215bedb1f92700b
- name: Run tests
working-directory: packages/contracts
run: yarn test
- name: Run script tests
working-directory: packages/contracts
run: yarn test:script
relayer:
name: relayer
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/[email protected]
with:
version: nightly-0079a1146b79a4aeda58b0258215bedb1f92700b
- name: Build contracts
working-directory: packages/contracts
run: yarn build
- name: Run tests
working-directory: packages/relayer
run: cargo test
stop-spot-vm:
name: Stop Spot VM
needs: [circuits, contracts, relayer]
runs-on: ubuntu-latest
steps:
- name: Authenticate with GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- name: Stop Spot VM
run: gcloud compute instances stop email-tx-builder-runner-spot --zone=us-central1-c