@@ -143,18 +143,47 @@ jobs:
143
143
command : build
144
144
args : --release --workspace
145
145
146
+ - name : Composer install
147
+ run : composer install --working-dir=tests/php
148
+
149
+ # Build mixture for cargo test.
146
150
- name : Docker compose
147
151
if : matrix.os == 'ubuntu-20.04'
148
152
run : docker compose up -d
149
153
154
+ # Build mixture for cargo test.
150
155
- name : Vagrant up for docker compose
151
156
if : matrix.os == 'macos-12'
152
157
run : vagrant up
153
158
154
- - name : Composer install
155
- run : composer install --working-dir=tests/php
159
+ # Try cargo test.
160
+ - name : Cargo test
161
+ id : cargo-test-step
162
+ uses : actions-rs/cargo@v1
163
+ with :
164
+ toolchain : ${{ env.RUST_STABLE_TOOLCHAIN }}
165
+ command : test
166
+ args : --release --workspace
167
+ continue-on-error : true
168
+
169
+ # Rebuild the mixture when cargo test failed.
170
+ - name : Docker compose restart
171
+ if : matrix.os == 'ubuntu-20.04' && steps.cargo-test-step.outcome != 'success'
172
+ run : docker compose restart
173
+
174
+ # Rebuild the mixture when cargo test failed.
175
+ - name : Vagrant reload for docker compose
176
+ if : matrix.os == 'macos-12' && steps.cargo-test-step.outcome != 'success'
177
+ run : vagrant reload
178
+
179
+ # Delay before retry.
180
+ - name : Delay
181
+ if : steps.cargo-test-step.outcome != 'success'
182
+ run : sleep 20
156
183
184
+ # Retry cargo test.
157
185
- name : Cargo test
186
+ if : steps.cargo-test-step.outcome != 'success'
158
187
uses : actions-rs/cargo@v1
159
188
with :
160
189
toolchain : ${{ env.RUST_STABLE_TOOLCHAIN }}
0 commit comments