From bf736d48cae25f229f76b4f9c8ee7e601a8a89d0 Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Thu, 10 Oct 2024 17:59:29 -0300 Subject: [PATCH] github: action: Add local tests --- .github/workflows/action.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index ff64d8f64..0c1e74d4f 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -36,6 +36,52 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./target/doc + compile-examples: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Compile examples for ARM v7 + uses: houseabsolute/actions-rust-cross@v0.0.14 + with: + target: armv7-unknown-linux-gnueabihf + args: "--examples --release" + - name: Upload compiled examples + uses: actions/upload-artifact@v4.4.3 + with: + name: examples-armv7 + path: target/armv7-unknown-linux-gnueabihf/release/examples/* + + local-tests: + needs: compile-examples + runs-on: raspbian-armv7-kernel-5.10.33 + if: ${{ github.repository_owner == 'bluerobotics' }} + steps: + - name: Run USB management script + run: /etc/github_runner/ci_management.sh + - name: Checkout repository + uses: actions/checkout@v2 + - name: Download compiled examples + uses: actions/download-artifact@v4 + with: + name: examples-armv7 + path: ./examples + - name: Make examples executable + run: | + chmod +x ./examples/* + - name: Run Tests + env: + STOP_ON_FAILURE: "false" # Set to "true" to stop on first failure + run: | + /etc/github_runner/run-tests.sh \ + "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" + # Add more tests here, each on a new line with a backslash at the end + - name: Post CI management script + if: always() + run: | + source /etc/github_runner/ci_management.sh + clear_busy_state + deploy: needs: build runs-on: ubuntu-latest