1
- name : Master
1
+ name : Rust Tests
2
2
3
3
on :
4
+ pull_request :
5
+ branches :
6
+ - master
4
7
push :
5
8
branches :
6
9
- master
7
10
8
11
jobs :
9
12
build :
10
- name : Run tests on ${{ matrix.toolchain }} ${{ matrix.target }}
13
+ name : ${{ matrix.toolchain }} / ${{ matrix.target }}
11
14
runs-on : ubuntu-latest
12
15
strategy :
16
+ fail-fast : false
13
17
matrix :
14
18
toolchain :
15
19
- stable
@@ -20,10 +24,14 @@ jobs:
20
24
- wasm32-unknown-unknown
21
25
steps :
22
26
- uses : actions/checkout@v2
27
+
28
+ # Setup musl if needed
23
29
- run : sudo apt-get update
24
30
if : matrix.target == 'x86_64-unknown-linux-musl'
25
31
- run : sudo apt-get install -y musl musl-dev musl-tools cmake
26
32
if : matrix.target == 'x86_64-unknown-linux-musl'
33
+
34
+ # Caching stuff
27
35
- name : Cache cargo registry
28
36
uses : actions/cache@v1
29
37
with :
@@ -47,12 +55,14 @@ jobs:
47
55
48
56
# If glibc, compile and test all
49
57
- uses : actions-rs/cargo@v1
58
+ name : " Build"
50
59
if : matrix.target == 'x86_64-unknown-linux-gnu'
51
60
with :
52
61
command : build
53
62
toolchain : ${{ matrix.toolchain }}
54
63
args : --target ${{ matrix.target }} --workspace
55
64
- uses : actions-rs/cargo@v1
65
+ name : " Test"
56
66
if : matrix.target == 'x86_64-unknown-linux-gnu'
57
67
with :
58
68
command : test
61
71
62
72
# If musl, compile and test all
63
73
- uses : actions-rs/cargo@v1
74
+ name : " Build"
64
75
if : matrix.target == 'x86_64-unknown-linux-musl'
65
76
with :
66
77
command : build
70
81
CC : musl-gcc
71
82
CXX : g++
72
83
- uses : actions-rs/cargo@v1
84
+ name : " Test"
73
85
if : matrix.target == 'x86_64-unknown-linux-musl'
74
86
with :
75
87
command : test
@@ -78,10 +90,37 @@ jobs:
78
90
env :
79
91
CC : musl-gcc
80
92
CXX : g++
93
+
81
94
# If wasm, then we test only the main module and cloudevents-sdk-reqwest
82
95
- uses : actions-rs/cargo@v1
96
+ name : " Build"
83
97
if : matrix.target == 'wasm32-unknown-unknown'
84
98
with :
85
99
command : build
86
100
toolchain : ${{ matrix.toolchain }}
87
101
args : --target wasm32-unknown-unknown --package cloudevents-sdk --package cloudevents-sdk-reqwest
102
+
103
+ # Build examples
104
+ - uses : actions-rs/cargo@v1
105
+ name : " Build reqwest-wasm-example"
106
+ if : matrix.target == 'wasm32-unknown-unknown' && matrix.toolchain == 'stable'
107
+ with :
108
+ command : build
109
+ toolchain : ${{ matrix.toolchain }}
110
+ args : --target ${{ matrix.target }} --manifest-path ./example-projects/reqwest-wasm-example/Cargo.toml
111
+
112
+ - uses : actions-rs/cargo@v1
113
+ name : " Build rdkafka-example"
114
+ if : matrix.target == 'x86_64-unknown-linux-gnu' && matrix.toolchain == 'stable'
115
+ with :
116
+ command : build
117
+ toolchain : ${{ matrix.toolchain }}
118
+ args : --target ${{ matrix.target }} --manifest-path ./example-projects/rdkafka-example/Cargo.toml
119
+
120
+ - uses : actions-rs/cargo@v1
121
+ name : " Build actix-web-example"
122
+ if : matrix.target == 'x86_64-unknown-linux-gnu' && matrix.toolchain == 'stable'
123
+ with :
124
+ command : build
125
+ toolchain : ${{ matrix.toolchain }}
126
+ args : --target ${{ matrix.target }} --manifest-path ./example-projects/actix-web-example/Cargo.toml
0 commit comments