-
Notifications
You must be signed in to change notification settings - Fork 53
182 lines (161 loc) · 6.13 KB
/
backend-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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: tests
on: [push, pull_request, workflow_dispatch]
env:
C_KZG_4844_GIT_HASH: '1bccee0878ffc80efe8741afdb5793ef9105aa35'
jobs:
kzg_ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Check kzg clippy for default msm backend
- name: "kzg clippy"
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path kzg/Cargo.toml --all-targets --no-default-features --features=parallel,std,rand -- -D warnings
# Check kzg clippy for BGMW msm backend
- name: "kzg clippy (bgmw)"
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path kzg/Cargo.toml --all-targets --features=parallel,std,rand,bgmw -- -D warnings
# Check kzg clippy for arkmsm backend
- name: "kzg clippy (arkmsm)"
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path kzg/Cargo.toml --all-targets --features=parallel,std,rand,arkmsm -- -D warnings
# Check kzg clippy for sppark backend
- name: "kzg clippy (sppark)"
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path kzg/Cargo.toml --all-targets --features=parallel,std,rand,sppark -- -D warnings
# Check kzg formatting
- name: "kzg format"
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path kzg/Cargo.toml -- --check
# Check kzg-bench clippy
- name: "kzg-bench clippy"
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path kzg-bench/Cargo.toml --all-targets --all-features -- -D warnings
# Check kzg-bench formatting
- name: "kzg-bench format"
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path kzg-bench/Cargo.toml -- --check
backend_ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Excluding mcl for now due to they have different project layout
backend: [blst, zkcrypto, arkworks, arkworks3, constantine]
include:
# Set default clippy flag
- clippy-flag: --features=default,std,rand,parallel
# Setup exec_once_per_backend flag
- os: ubuntu-latest
exec_once_per_backend: true
# Select backends which support wasm & which support ckzg drop-in
- backend: blst
support_wasm: true
support_ckzg: true
- backend: zkcrypto
support_wasm: true
support_ckzg: true
clippy-flag: --all-features
- backend: arkworks
support_wasm: true
support_ckzg: true
- backend: arkworks3
support_wasm: true
support_ckzg: true
- backend: constantine
# FIXME: Check for wasm support
support_wasm: false
support_ckzg: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
- uses: jiro4989/setup-nim-action@v2
with:
nim-version: '2.0.2'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install py_ecc
pip install PyYAML
- uses: actions/setup-go@v2
with:
go-version: ^1.19
# Install constantine backend deps
- name: "constantine - install deps"
if: matrix.backend == 'constantine' && matrix.os == 'ubuntu-latest'
run: |
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
--no-install-recommends -yq \
libgmp-dev \
llvm
# Check backend clippy
- name: "${{ matrix.backend }} clippy"
if: matrix.exec_once_per_backend
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path ${{ matrix.backend }}/Cargo.toml --all-targets ${{ matrix.clippy-flag }} -- -D warnings
# Check backend formatting
- name: "${{ matrix.backend }} format"
if: matrix.exec_once_per_backend
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ${{ matrix.backend }}/Cargo.toml -- --check
# Check wasm32 target clippy for backend
- name: "[wasm32] ${{ matrix.backend }} clippy"
if: matrix.exec_once_per_backend && matrix.support_wasm
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path ${{ matrix.backend }}/Cargo.toml --target wasm32-unknown-unknown --no-default-features
# Check wasm32 target backend build
- name: "[wasm32] ${{ matrix.backend }} build"
if: matrix.exec_once_per_backend && matrix.support_wasm
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ${{ matrix.backend }}/Cargo.toml --target wasm32-unknown-unknown --no-default-features
# Check non-parallel backend tests
- name: "${{ matrix.backend }} Tests"
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path ${{ matrix.backend }}/Cargo.toml --no-fail-fast --release
# Check parallel backend tests
- name: "${{ matrix.backend }} Tests (parallel)"
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path ${{ matrix.backend }}/Cargo.toml --no-fail-fast --release --features parallel
# Check ckzg backend tests
- name: "${{ matrix.backend }} Tests (c-kzg-4844)"
if: matrix.exec_once_per_backend && matrix.support_ckzg
run: |
bash run-c-kzg-4844-tests.sh ${{ matrix.backend }}
# Check parallel ckzg backend tests
- name: "${{ matrix.backend }} Tests (c-kzg-4844 parallel)"
if: matrix.exec_once_per_backend && matrix.support_ckzg
run: |
bash run-c-kzg-4844-tests.sh --parallel ${{ matrix.backend }}