iox-#2330 add notify systemd #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build for systemd | |
on: | |
push: | |
branches: [ main , iox-*] | |
pull_request: | |
branches: [ main, release*, iox-* ] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update | |
run: sudo apt update | |
- name: Install depends | |
run: sudo apt install -y gcc g++ cmake libacl1-dev libncurses5-dev pkg-config libsystemd-dev | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cmake cache | |
run: cmake -Bbuild -Hiceoryx_meta -DBUILD_SHARED_LIBS=ON -DUSE_SYSTEMD=ON | |
- name: build | |
run: cmake --build build -j 16 | |
- name: Install | |
run: sudo cmake --build build --target install | |
- name: Ldconfig run | |
run: sudo ldconfig | |
- name: Create unit file | |
run: echo -e "[Unit]\nDescription=Test application roudi\n\n[Service]\nType=notify\nRestartSec=10\nRestart=always\nExecStart=/usr/local/bin/iox-roudi\nTimeoutStartSec=10\nWatchdogSec=5\n\n[Install]\nWantedBy=multi-user.target" | sudo tee /usr/lib/systemd/system/test_iox.service > /dev/null | |
- name: Show unit | |
run: cat /usr/lib/systemd/system/test_iox.service | |
- name: Daemon reload | |
run: sudo systemctl daemon-reload | |
- name: Check status | |
run: sudo systemctl status test_iox || true | |
- name: Start roudi | |
run: | | |
sudo systemctl start test_iox || (echo "Failed to start service"; sudo journalctl -u test_iox -n 50; exit 1) | |
- name: Wait for 30 seconds | |
run: sleep 30 | |
- name: Check roudi | |
run: sudo systemctl status test_iox || (echo "Failed to start service"; sudo journalctl -u test_iox -n 50; exit 1) | |
- name: Stop roudi | |
run: sudo systemctl stop test_iox | |
- name: Show journal | |
run: sudo journalctl -u test_iox -n 100 |