-
Notifications
You must be signed in to change notification settings - Fork 16
149 lines (127 loc) · 3.79 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- v*
paths-ignore:
- "README.md"
jobs:
# cargo-fmt:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Cargo fmt
# run: |
# rustup component add rustfmt
# cargo fmt --all -- --check
cargo-clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- run: rustup component add clippy
- name: Cargo clippy
# We run clippy twice (once without tests), so that it accurately reports dead code in the non-test configuration.
# `manual_range_contains` is disabled because a >= x && a < y reads more clearly than (x..y).contains(a) and
# there are additional caveats for floating point numbers (https://github.com/rust-lang/rust-clippy/issues/6455)
run: |
cargo clippy -- -D clippy::all -D warnings -A clippy::manual_range_contains
cargo clippy --tests --benches -- -D clippy::all -D warnings -A clippy::manual_range_contains
# cargo-deny:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - run: cargo install --locked cargo-deny
# - name: Cargo deny
# run: |
# cargo-deny check --hide-inclusion-graph || true
# cargo-audit:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - run: cargo install --locked cargo-audit
# - name: Cargo audit
# run: |
# cargo audit || true
# cargo-check:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Cargo build
# uses: actions-rs/cargo@master
# with:
# command: check
# args: --all-targets
# cargo-build:
# runs-on: ubuntu-latest
# # needs: cargo-check
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Cargo build
# uses: actions-rs/cargo@master
# with:
# command: build
# args: --tests --release
cargo-wasm-build:
runs-on: ubuntu-latest
# needs: cargo-check
steps:
- name: Checkout
uses: actions/checkout@master
- name: Cargo build
uses: actions-rs/cargo@master
with:
command: build
args: --tests --release --target wasm32-unknown-unknown
cargo-test:
runs-on: ubuntu-latest
# needs: cargo-check
steps:
- name: Checkout
uses: actions/checkout@master
- name: Cargo test
uses: actions-rs/cargo@master
with:
command: test
# candid-check:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Check interface
# run: |
# cargo run > candid/eth_rpc_expected.did
# diff candid/eth_rpc.did candid/eth_rpc_expected.did
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: Swatinem/rust-cache@v2
- name: Install dfx
run: |
wget --output-document install-dfx.sh "https://internetcomputer.org/install.sh"
bash install-dfx.sh < <(yes Y)
rm install-dfx.sh
dfx cache install
echo "$HOME/bin" >> $GITHUB_PATH
- name: Start dfx
run: dfx start --background
- name: Install npm packages
run: npm ci
- name: Deploy
run: dfx deploy
- name: Test (Motoko)
run: dfx canister call e2e_motoko test
- name: Test (Rust)
run: dfx canister call e2e_rust test
- name: Check formatting
run: cargo fmt --all -- --check