-
Notifications
You must be signed in to change notification settings - Fork 63
98 lines (91 loc) · 2.81 KB
/
github-actions.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
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
workflow_dispatch:
jobs:
check:
name: check dubbo-rust project
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@main
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: setup protoc
run: |
mkdir $HOME/protoc/ -p &&
cd $HOME/protoc/ &&
curl --location --silent --output /tmp/protoc-21.9-linux-x86_64.zip \
https://github.com/protocolbuffers/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip &&
unzip /tmp/protoc-21.9-linux-x86_64.zip &&
echo "$HOME/protoc/bin" >> $GITHUB_PATH
shell: bash
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
- run: cargo check
example-greeter:
name: example/greeter
runs-on: ubuntu-latest
services:
zoo1:
image: zookeeper:3.8
ports:
- 2181:2181
env:
ZOO_MY_ID: 1
steps:
- uses: actions/checkout@main
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: setup protoc
run: |
mkdir $HOME/protoc/ -p &&
cd $HOME/protoc/ &&
curl --location --silent --output /tmp/protoc-21.9-linux-x86_64.zip \
https://github.com/protocolbuffers/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip &&
unzip /tmp/protoc-21.9-linux-x86_64.zip &&
echo "$HOME/protoc/bin" >> $GITHUB_PATH
shell: bash
- run: cargo build
working-directory: examples/greeter
- name: example greeter
run: |
../../target/debug/greeter-server &
sleep 3
../../target/debug/greeter-client
env:
ZOOKEEPER_SERVERS: 127.0.0.1:2181
DUBBO_CONFIG_PATH: ./application.yaml
working-directory: examples/greeter