@@ -24,10 +24,14 @@ jobs:
24
24
- wasm32-unknown-unknown
25
25
steps :
26
26
- uses : actions/checkout@v2
27
+
28
+ # Setup musl if needed
27
29
- run : sudo apt-get update
28
30
if : matrix.target == 'x86_64-unknown-linux-musl'
29
31
- run : sudo apt-get install -y musl musl-dev musl-tools cmake
30
32
if : matrix.target == 'x86_64-unknown-linux-musl'
33
+
34
+ # Caching stuff
31
35
- name : Cache cargo registry
32
36
uses : actions/cache@v1
33
37
with :
@@ -51,12 +55,14 @@ jobs:
51
55
52
56
# If glibc, compile and test all
53
57
- uses : actions-rs/cargo@v1
58
+ name : " Build"
54
59
if : matrix.target == 'x86_64-unknown-linux-gnu'
55
60
with :
56
61
command : build
57
62
toolchain : ${{ matrix.toolchain }}
58
63
args : --target ${{ matrix.target }} --workspace
59
64
- uses : actions-rs/cargo@v1
65
+ name : " Test"
60
66
if : matrix.target == 'x86_64-unknown-linux-gnu'
61
67
with :
62
68
command : test
65
71
66
72
# If musl, compile and test all
67
73
- uses : actions-rs/cargo@v1
74
+ name : " Build"
68
75
if : matrix.target == 'x86_64-unknown-linux-musl'
69
76
with :
70
77
command : build
74
81
CC : musl-gcc
75
82
CXX : g++
76
83
- uses : actions-rs/cargo@v1
84
+ name : " Test"
77
85
if : matrix.target == 'x86_64-unknown-linux-musl'
78
86
with :
79
87
command : test
@@ -85,56 +93,34 @@ jobs:
85
93
86
94
# If wasm, then we test only the main module and cloudevents-sdk-reqwest
87
95
- uses : actions-rs/cargo@v1
96
+ name : " Build"
88
97
if : matrix.target == 'wasm32-unknown-unknown'
89
98
with :
90
99
command : build
91
100
toolchain : ${{ matrix.toolchain }}
92
101
args : --target wasm32-unknown-unknown --package cloudevents-sdk --package cloudevents-sdk-reqwest
93
102
94
- build-examples :
95
- name : Examples ${{ matrix.toolchain }} / ${{ matrix.target }}
96
- runs-on : ubuntu-latest
97
- needs : build
98
- strategy :
99
- fail-fast : false
100
- matrix :
101
- target :
102
- - x86_64-unknown-linux-gnu
103
- - wasm32-unknown-unknown
104
- steps :
105
- - uses : actions/checkout@v2
106
- - name : Cache cargo registry
107
- uses : actions/cache@v1
108
- with :
109
- path : ~/.cargo/registry
110
- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
111
- - name : Cache cargo index
112
- uses : actions/cache@v1
113
- with :
114
- path : ~/.cargo/git
115
- key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
116
- - name : Cache cargo build
117
- uses : actions/cache@v1
118
- with :
119
- path : target
120
- key : ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-stable-${{ hashFiles('**/Cargo.lock') }}
121
- - uses : actions-rs/toolchain@v1
122
- with :
123
- toolchain : ${{ matrix.toolchain }}
124
- target : ${{ matrix.target }}
125
- override : true
126
-
127
- - name : " Build reqwest-wasm-example"
128
- if : matrix.target == 'wasm32-unknown-unknown'
129
- working-directory : ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example
130
- run : cargo build --target ${{ matrix.target }}
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 ${GITHUB_WORKSPACE}/example-projects/reqwest-wasm-example/Cargo.toml
131
111
132
- - name : " Build rdkafka-example"
133
- if : matrix.target == 'x86_64-unknown-linux-gnu'
134
- working-directory : ${GITHUB_WORKSPACE}/example-projects/rdkafka-example
135
- run : cargo build --target ${{ matrix.target }}
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 ${GITHUB_WORKSPACE}/example-projects/rdkafka-example/Cargo.toml
136
119
137
- - name : " Build actix-web-example"
138
- if : matrix.target == 'x86_64-unknown-linux-gnu'
139
- working-directory : ${GITHUB_WORKSPACE}/example-projects/actix-web-example
140
- run : cargo build --target ${{ matrix.target }}
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 ${GITHUB_WORKSPACE}/example-projects/actix-web-example/Cargo.toml
0 commit comments