@@ -4,14 +4,14 @@ name: CI
4
4
5
5
on :
6
6
push :
7
- branches : [ main ]
7
+ branches : ["*" ]
8
8
pull_request :
9
- branches : [ main ]
9
+ branches : ["*" ]
10
10
11
11
workflow_dispatch :
12
12
13
13
jobs :
14
- check :
14
+ check :
15
15
name : check dubbo-rust project
16
16
runs-on : ${{ matrix.os }}
17
17
strategy :
@@ -21,28 +21,63 @@ jobs:
21
21
22
22
env :
23
23
RUSTFLAGS : " -D warnings"
24
-
24
+
25
25
steps :
26
- - uses : actions/checkout@main
27
- - uses : actions-rs/toolchain@v1
28
- with :
26
+ - uses : actions/checkout@main
27
+ - uses : actions-rs/toolchain@v1
28
+ with :
29
29
toolchain : ${{ matrix.rust }}
30
- - name : Install Protoc
31
- uses : arduino/setup-protoc@v1
32
- - run : cargo check
33
-
34
- fmt :
30
+ - name : Install Protoc
31
+ uses : arduino/setup-protoc@v1
32
+ with :
33
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
34
+ - run : cargo check
35
+
36
+ fmt :
35
37
name : Rustfmt
36
38
runs-on : ${{ matrix.os }}
37
39
strategy :
38
40
matrix :
39
41
os : [ubuntu-latest, macOS-latest, windows-latest]
40
42
rust : [stable]
41
-
43
+
42
44
steps :
43
45
- uses : actions/checkout@main
44
46
- uses : actions-rs/toolchain@v1
45
47
with :
46
48
toolchain : ${{ matrix.rust }}
47
49
- run : rustup component add rustfmt
48
50
- run : cargo fmt --all -- --check
51
+
52
+ example-greeter :
53
+ name : example/greeter
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - uses : actions/checkout@main
57
+ - uses : actions-rs/toolchain@v1
58
+ with :
59
+ toolchain : stable
60
+ - name : Install Protoc
61
+ uses : arduino/setup-protoc@v1
62
+ with :
63
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
64
+ - name : Set up cargo cache
65
+ uses : actions/cache@v3
66
+ continue-on-error : false
67
+ with :
68
+ path : |
69
+ ~/.cargo/bin/
70
+ ~/.cargo/registry/index/
71
+ ~/.cargo/registry/cache/
72
+ ~/.cargo/git/db/
73
+ target/
74
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
75
+ restore-keys : ${{ runner.os }}-cargo-
76
+ - run : cargo build
77
+ working-directory : examples/greeter
78
+ - name : example greeter
79
+ run : |
80
+ ../../target/debug/greeter-server &
81
+ sleep 1s ;
82
+ ../../target/debug/greeter-client
83
+ working-directory : examples/greeter
0 commit comments