From 61e21da297643f8b59d10598c1763aa6d6e106ea Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Thu, 10 Oct 2024 14:02:18 -0300 Subject: [PATCH] test --- .github/workflows/action.yml | 49 +++++++++++++++++------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 474b41090..b716be9b2 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -36,50 +36,47 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./target/doc - compile-example: + compile-examples: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - name: Compile ping_1d example for ARM v7 + - name: Compile examples for ARM v7 uses: houseabsolute/actions-rust-cross@v0.0.14 with: target: armv7-unknown-linux-gnueabihf - args: "--example ping_1d --release" - - name: Upload compiled example + args: "--examples --release" + - name: Upload compiled examples uses: actions/upload-artifact@v4.4.3 with: - name: ping_1d-armv7 - path: target/armv7-unknown-linux-gnueabihf/release/examples/ping_1d + name: examples-armv7 + path: target/armv7-unknown-linux-gnueabihf/release/examples/* tests: - needs: compile-example + needs: compile-examples runs-on: raspbian-armv7-kernel-5.10.33 if: ${{ github.repository_owner == 'bluerobotics' }} steps: - name: Run CI management script run: /etc/github_runner/ci_management.sh - - name: Download compiled ping_1d example + - name: Checkout repository + uses: actions/checkout@v2 + - name: Download compiled examples uses: actions/download-artifact@v4 with: - name: ping_1d-armv7 - path: ./ping_1d-armv7 - - name: Make ping_1d executable - run: chmod +x ./ping_1d-armv7/ping_1d - - name: Run ping_1d test + name: examples-armv7 + path: ./examples + - name: Make examples executable + run: | + chmod +x ./examples/* + - name: Run Tests + env: + TESTS: | + "Basic Ping1D Test w Ping1:ping_1d:--serial-port /dev/ttyUSB_Ping1:30" + "Basic Ping1D Test w Ping2:ping_1d:--serial-port /dev/ttyUSB_Ping2:30" + # "Test Name:ExampleName:AdditionalArgs:Timeout" + STOP_ON_FAILURE: "false" # Set to "true" to stop on first failure run: | - set +e - timeout 30s ./ping_1d-armv7/ping_1d --serial-port /dev/ttyUSB_Ping1 - exit_code=$? - set -e - if [ $exit_code -eq 124 ]; then - echo "Test timed out after 30 seconds" - exit 1 - elif [ $exit_code -ne 0 ]; then - echo "Test failed with exit code $exit_code" - exit $exit_code - else - echo "Test completed successfully" - fi + /etc/github_runner/run-tests.sh $TESTS - name: Post CI management script if: always() run: |