From 3c613f205c42ed502985c87f42a097e0aa9fd912 Mon Sep 17 00:00:00 2001 From: YEZZFUSL <18398621+yezzfusl@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:28:05 -0400 Subject: [PATCH] build.yml --- .github/workflows/build.yml | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8d10f50 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +name: Build CAN Analyzer + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y can-utils libc6-dev gcc make gnuplot + + - name: Build project + run: make + + - name: Run tests + run: | + # Setup virtual CAN interface + sudo modprobe vcan + sudo ip link add dev vcan0 type vcan + sudo ip link set up vcan0 + + # Run CAN Analyzer in background + ./can_analyzer vcan0 & + CAN_PID=$! + + # Send test messages + cansend vcan0 123#DEADBEEF + cansend vcan0 456#01234567 + + # Wait for a moment to allow processing + sleep 5 + + # Kill CAN Analyzer + kill $CAN_PID + + # Check if graph was generated + if [ -f can_data.png ]; then + echo "Graph generated successfully" + else + echo "Graph generation failed" + exit 1 + fi + + - name: Upload graph artifact + uses: actions/upload-artifact@v2 + with: + name: can-data-graph + path: can_data.png