Skip to content

Update build_test_ci.yml #6

Update build_test_ci.yml

Update build_test_ci.yml #6

Workflow file for this run

name: Desktop Notification Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set Up Dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb x11-apps x11-utils strace
- name: Create and Run Notification Test Script
run: bash -c 'cat << EOF > test_notifications.sh; #!/bin/bash; # Test script for desktop notifications; xvfb-run -a -s "-screen 0 1024x768x24" sh -c "echo \"Running notify-send test...\"; strace -o /tmp/notify-send-strace.log notify-send \"Test Notification\" \"This is a test message.\"; if [ $? -ne 0 ]; then echo \"notify-send failed\"; exit 1; fi; echo \"Running alternative notification command...\"; # Uncomment if using KDE; # kdialog --passivepopup \"Test Notification\" \"This is a test message.\"; # Uncomment if using XFCE; # xfce4-notifyd \"Test Notification\" \"This is a test message.\"; echo \"Notification test completed. Check logs for details.\""; chmod +x test_notifications.sh; ./test_notifications.sh; echo "Displaying strace log:"; cat /tmp/notify-send-strace.log; EOF'
env:
DISPLAY: :99 # Set the DISPLAY environment variable for xvfb
- name: Check Notification Test Log
run: |
if [ -f /tmp/notify-send-strace.log ]; then
if grep -q "notify-send" /tmp/notify-send-strace.log; then
echo "Notification test passed"
exit 0
else
echo "Notification test failed"
exit 1
fi
else
echo "Strace log file not found"
exit 1
fi