-
Notifications
You must be signed in to change notification settings - Fork 15
75 lines (61 loc) · 1.74 KB
/
rust-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
name: Rust CI
on:
pull_request:
push:
branches: ['main']
jobs:
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Add `rustfmt` to toolchain
run: rustup +nightly component add rustfmt
- name: Format
run: cargo +nightly fmt --check
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
sdk/rust
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: cargo check --workspace
test:
needs: ['check']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Start the local node
run: npx @hashgraph/[email protected] start -d --network local
- name: "Create env file"
run: |
touch .env
echo OPERATOR_KEY="302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" >> .env
echo OPERATOR_ID="0.0.2" >> .env
echo HEDERA_NETWORK="localhost" >> .env
echo TEST_RUN_NONFREE="1" >> .env
cat .env
- name: Test
run: cargo test --workspace
- name: Stop the local node
run: npx @hashgraph/[email protected] stop