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
@@ -78,10 +81,59 @@ jobs:
78
81
env :
79
82
CC : musl-gcc
80
83
CXX : g++
84
+
81
85
# If wasm, then we test only the main module and cloudevents-sdk-reqwest
82
86
- uses : actions-rs/cargo@v1
83
87
if : matrix.target == 'wasm32-unknown-unknown'
84
88
with :
85
89
command : build
86
90
toolchain : ${{ matrix.toolchain }}
87
91
args : --target wasm32-unknown-unknown --package cloudevents-sdk --package cloudevents-sdk-reqwest
92
+
93
+ build-examples :
94
+ name : Build examples
95
+ runs-on : ubuntu-latest
96
+ needs : build
97
+ strategy :
98
+ matrix :
99
+ target :
100
+ - x86_64-unknown-linux-gnu
101
+ - wasm32-unknown-unknown
102
+ steps :
103
+ - uses : actions/checkout@v2
104
+ - name : Cache cargo registry
105
+ uses : actions/cache@v1
106
+ with :
107
+ path : ~/.cargo/registry
108
+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
109
+ - name : Cache cargo index
110
+ uses : actions/cache@v1
111
+ with :
112
+ path : ~/.cargo/git
113
+ key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
114
+ - name : Cache cargo build
115
+ uses : actions/cache@v1
116
+ with :
117
+ path : target
118
+ key : ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-stable-${{ hashFiles('**/Cargo.lock') }}
119
+ - uses : actions-rs/toolchain@v1
120
+ with :
121
+ toolchain : ${{ matrix.toolchain }}
122
+ target : ${{ matrix.target }}
123
+ override : true
124
+
125
+ # Build examples
126
+ - name : " Build reqwest-wasm-example"
127
+ if : matrix.target == 'wasm32-unknown-unknown'
128
+ working-directory : ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example
129
+ run : cargo build --target ${{ matrix.target }}
130
+
131
+ - name : " Build rdkafka-example"
132
+ if : matrix.target == 'x86_64-unknown-linux-gnu'
133
+ working-directory : ${GITHUB_WORKSPACE}/example-projects/rdkafka-example
134
+ run : cargo build --target ${{ matrix.target }}
135
+
136
+ - name : " Build actix-web-example"
137
+ if : matrix.target == 'x86_64-unknown-linux-gnu'
138
+ working-directory : ${GITHUB_WORKSPACE}/example-projects/actix-web-example
139
+ run : cargo build --target ${{ matrix.target }}
0 commit comments