-
Notifications
You must be signed in to change notification settings - Fork 18
180 lines (141 loc) · 4.71 KB
/
qaci.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
name: QACI
on:
push:
branches:
- master
pull_request:
branches:
- master
- develop
env:
CARGO_TERM_COLOR: always
WASM_BINDGEN_TEST_TIMEOUT: 120
jobs:
build_wasm:
name: Build and test for wasm
timeout-minutes: 10
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup rust toolchain
run: rustup show
- uses: jetli/[email protected]
with:
version: "0.2.89"
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v2
with:
shared-key: wasm-v1
- name: Run clippy for core wasm
run: cargo clippy -p rings-core --features wasm --no-deps --no-default-features --target=wasm32-unknown-unknown --tests -- -D warnings
- name: Run clippy for node browser
run: cargo clippy -p rings-node --features browser --no-deps --no-default-features --target=wasm32-unknown-unknown --tests -- -D warnings
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Run core browser tests
uses: coactions/setup-xvfb@v1
with:
run: cargo test -p rings-core --target=wasm32-unknown-unknown --features wasm --no-default-features
working-directory: ./
- name: Run node browser tests
uses: coactions/setup-xvfb@v1
with:
run: cargo test -p rings-node --release --target=wasm32-unknown-unknown --features browser --no-default-features
working-directory: ./
build:
name: Build and test
timeout-minutes: 25
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup rust toolchain
run: rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v2
with:
shared-key: default-v1
- name: Build
run: cargo build --all --verbose
- name: Run doc tests
run: cargo test --doc
- name: Run dummy tests
run: cargo test -p rings-core --features dummy --verbose
- name: Run tests
run: cargo test --release --all --verbose
build_ffi:
name: Build and test for examples
timeout-minutes: 20
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup rust toolchain
run: rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v2
with:
shared-key: ffi-${{ matrix.os }}-v1
- name: Run clippy for node ffi
run: cargo clippy -p rings-node --features ffi
- name: Build
run: cargo build -p rings-node --features ffi
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Smoke test ffi
run: pip install wheel && pip install web3 cffi && python examples/ffi/rings.py
# - name: Smoke test native
# run: cargo run -p rings-native-example
rustfmt_and_clippy:
name: Check rustfmt style && run clippy
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check typos
uses: crate-ci/typos@master
- name: Setup protoc
uses: arduino/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup rust toolchain
run: |
rustup install nightly
rustup component add rustfmt --toolchain nightly
rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v2
with:
shared-key: static-v1
- name: Run clippy
run: cargo clippy --all --tests -- -D warnings
- name: Check formating
run: cargo +nightly fmt --all -- --check
- name: Check docs
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --all --no-deps
- name: Install taplo
run: cargo install taplo-cli --locked
- name: Check toml file formating by taplo
run: taplo format --check