You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/01/13 03:50:37 UTC

[skywalking-php] branch master updated: Retry cargo test when failed in CI. (#44)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-php.git


The following commit(s) were added to refs/heads/master by this push:
     new c14f903  Retry cargo test when failed in CI. (#44)
c14f903 is described below

commit c14f903b918be5b87ba91aec01ccb02f35510fdf
Author: jmjoy <jm...@apache.org>
AuthorDate: Fri Jan 13 11:50:32 2023 +0800

    Retry cargo test when failed in CI. (#44)
---
 .github/workflows/rust.yml | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 14aa223..4ddd2a3 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -143,18 +143,47 @@ jobs:
           command: build
           args: --release --workspace
 
+      - name: Composer install
+        run: composer install --working-dir=tests/php
+
+      # Build mixture for cargo test.
       - name: Docker compose
         if: matrix.os == 'ubuntu-20.04'
         run: docker compose up -d
 
+      # Build mixture for cargo test.
       - name: Vagrant up for docker compose
         if: matrix.os == 'macos-12'
         run: vagrant up
 
-      - name: Composer install
-        run: composer install --working-dir=tests/php
+      # Try cargo test.
+      - name: Cargo test
+        id: cargo-test-step
+        uses: actions-rs/cargo@v1
+        with:
+          toolchain: ${{ env.RUST_STABLE_TOOLCHAIN }}
+          command: test
+          args: --release --workspace
+        continue-on-error: true
+
+      # Rebuild the mixture when cargo test failed.
+      - name: Docker compose restart
+        if: matrix.os == 'ubuntu-20.04' && steps.cargo-test-step.outcome != 'success'
+        run: docker compose restart
+
+      # Rebuild the mixture when cargo test failed.
+      - name: Vagrant reload for docker compose
+        if: matrix.os == 'macos-12' && steps.cargo-test-step.outcome != 'success'
+        run: vagrant reload
+
+      # Delay before retry.
+      - name: Delay
+        if: steps.cargo-test-step.outcome != 'success'
+        run: sleep 20
 
+      # Retry cargo test.
       - name: Cargo test
+        if: steps.cargo-test-step.outcome != 'success'
         uses: actions-rs/cargo@v1
         with:
           toolchain: ${{ env.RUST_STABLE_TOOLCHAIN }}