Skip to content

Commit

Permalink
build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yezzfusl authored Jul 31, 2024
1 parent b03ddc7 commit 3c613f2
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3c613f2

Please sign in to comment.