-
Notifications
You must be signed in to change notification settings - Fork 5
140 lines (120 loc) · 3.84 KB
/
Basic.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
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
# Pushes to long living branches and all PRs
on:
push:
branches:
- main
pull_request:
name: Basic
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
bls_lib: [zkcrypto, arkworks, arkworks-asm]
include:
- bls_lib: arkworks-asm
rustflags: RUSTFLAGS="-C target-feature=+bmi2,+adx"
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
profile: minimal
target: wasm32-unknown-unknown
default: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --features ${{ matrix.bls_lib }}
- name: Build with js feature
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --features ${{ matrix.bls_lib }},js
- name: Build Wasm
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --lib --target wasm32-unknown-unknown --features ${{ matrix.bls_lib }}
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --features ${{ matrix.bls_lib }}
env:
RUST_BACKTRACE: 1
bench:
name: Benchmarks
runs-on: ubuntu-latest
strategy:
matrix:
bls_lib: [zkcrypto, arkworks, arkworks-asm]
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
default: true
- name: Set RUSTFLAGS
if: ${{ matrix.rustflags }}
run: echo ${{ matrix.rustflags }} >> $GITHUB_ENV
- name: Run Benchmarks
uses: actions-rs/cargo@v1
with:
command: bench
args: bench_ --no-default-features --features ${{ matrix.bls_lib }}
examples:
name: Build and run examples
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
profile: minimal
target: wasm32-unknown-unknown
default: true
- name: Build all
uses: actions-rs/cargo@v1
with:
command: build
args: --examples --locked
env:
RUST_BACKTRACE: 1
- name: Run example cli
# curl -sS https://drand.cloudflare.com/public/72785
run: ./target/debug/examples/drand_verify 72785 a609e19a03c2fcc559e8dae14900aaefe517cb55c840f6e69bc8e4f66c8d18e8a609685d9917efbfb0c37f058c2de88f13d297c7e19e0ab24813079efe57a182554ff054c7638153f9b26a60e7111f71a0ff63d9571704905d3ca6df0b031747 82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
profile: minimal
components: rustfmt, clippy
default: true
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
# Cannot use --all-targets because benches require Rust nightly
args: --tests --examples -- -D warnings