1- name : Master
1+ name : Rust Tests
22
33on :
4+ pull_request :
5+ branches :
6+ - master
47 push :
58 branches :
69 - master
710
811jobs :
912 build :
10- name : Run tests on ${{ matrix.toolchain }} ${{ matrix.target }}
13+ name : ${{ matrix.toolchain }} / ${{ matrix.target }}
1114 runs-on : ubuntu-latest
1215 strategy :
16+ fail-fast : false
1317 matrix :
1418 toolchain :
1519 - stable
@@ -20,10 +24,14 @@ jobs:
2024 - wasm32-unknown-unknown
2125 steps :
2226 - uses : actions/checkout@v2
27+
28+ # Setup musl if needed
2329 - run : sudo apt-get update
2430 if : matrix.target == 'x86_64-unknown-linux-musl'
2531 - run : sudo apt-get install -y musl musl-dev musl-tools cmake
2632 if : matrix.target == 'x86_64-unknown-linux-musl'
33+
34+ # Caching stuff
2735 - name : Cache cargo registry
2836 uses : actions/cache@v1
2937 with :
@@ -47,12 +55,14 @@ jobs:
4755
4856 # If glibc, compile and test all
4957 - uses : actions-rs/cargo@v1
58+ name : " Build"
5059 if : matrix.target == 'x86_64-unknown-linux-gnu'
5160 with :
5261 command : build
5362 toolchain : ${{ matrix.toolchain }}
5463 args : --target ${{ matrix.target }} --workspace
5564 - uses : actions-rs/cargo@v1
65+ name : " Test"
5666 if : matrix.target == 'x86_64-unknown-linux-gnu'
5767 with :
5868 command : test
6171
6272 # If musl, compile and test all
6373 - uses : actions-rs/cargo@v1
74+ name : " Build"
6475 if : matrix.target == 'x86_64-unknown-linux-musl'
6576 with :
6677 command : build
7081 CC : musl-gcc
7182 CXX : g++
7283 - uses : actions-rs/cargo@v1
84+ name : " Test"
7385 if : matrix.target == 'x86_64-unknown-linux-musl'
7486 with :
7587 command : test
@@ -78,10 +90,37 @@ jobs:
7890 env :
7991 CC : musl-gcc
8092 CXX : g++
93+
8194 # If wasm, then we test only the main module and cloudevents-sdk-reqwest
8295 - uses : actions-rs/cargo@v1
96+ name : " Build"
8397 if : matrix.target == 'wasm32-unknown-unknown'
8498 with :
8599 command : build
86100 toolchain : ${{ matrix.toolchain }}
87101 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