-
Notifications
You must be signed in to change notification settings - Fork 28
138 lines (132 loc) · 4.29 KB
/
rust.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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main, debugger ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: linux-8core
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
${{ runner.os }}-cargo
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
mdBook/target
key: ${{ runner.os }}-cargo-mdBook-${{ hashFiles('mdBook/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-mdBook-
${{ runner.os }}-cargo-
# Checks are ordered from fastest to slowest so your build fails quickly on invalid PRs
# We do everything in release mode so tests run quickly and steps cache each other.
# Check the submitted change meets style guidelines
- name: Cargo Format
run: cargo fmt --check
# Build and run the tests
- name: Build and run tests
run: cargo test --workspace --verbose --release --features deterministic,linkedproofs
- name: Build sunscreen and bincode
run: cargo build --release --features bulletproofs,linkedproofs --package sunscreen --package bincode
- name: Build mdBook
run: cargo build --release
working-directory: ./mdBook
- name: Test docs
run: ../mdBook/target/release/mdbook test -L dependency=../target/release/deps --extern sunscreen=../target/release/libsunscreen.rlib --extern bincode=../target/release/libbincode.rlib
working-directory: ./sunscreen_docs
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-clippy-
${{ runner.os }}-cargo-
# Check the submitted change passes the clippy linter
- name: Cargo clippy
run: cargo clippy --release --all-targets -- --deny warnings
api_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-doc-
${{ runner.os }}-cargo-
# Cursory check to ensure your CL contains valid Rust code
- name: Cargo check
run: cargo check --release
# Check the documentation builds, links work, etc.
- name: Cargo doc
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --release --no-deps
emscripten:
runs-on: linux-8core
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-doc-
${{ runner.os }}-cargo-
- name: Install gcc-multilib (32-bit headers)
run: |
sudo apt-get update
sudo apt-get install gcc-multilib
- name: Emsdk install
run: emsdk/emsdk/emsdk install 3.1.3
- name: Emsdk activate
run: emsdk/emsdk/emsdk activate 3.1.3
- name: Add Rust wasm32-unknown-emscripten target
run: rustup target add wasm32-unknown-emscripten
- name: Build AMM target for Emscripten
run: source emsdk/emsdk/emsdk_env.sh; cargo build --bin amm --target wasm32-unknown-emscripten --release