Skip to content

Commit

Permalink
wip: verify output
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenautumns committed Nov 5, 2024
1 parent d7ff0c5 commit dcd9852
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,36 @@ jobs:
- name: Check CGroup
run: systemd-run --user --scope cat /proc/self/cgroup
- name: Run example ${{ matrix.example }}
run: nix develop --command systemd-run-example-${{ matrix.example }} --duration $DURATION
id: run_step
shell: nix develop --command bash -e {0}
run: systemd-run-example-${{ matrix.example }} --duration $DURATION 2>&1 | tee ./output.log
- name: Verify output
run: |
set -e
! grep "WARN" ./output.log
grep "WARN" ./output.log
! grep "ERROR" ./output.log
! grep "panic" ./output.log
if [ "${{ matrix.example }}" = "hello_part" ]; then
grep "WARN" ./output.log || true
grep "WARN" ./output.log | wc -l | awk '{exit($1 > 0)}'
fi
if [ "${{ matrix.example }}" = "fuel_tank" ]; then
grep "WARN" ./output.log || true
grep "WARN" ./output.log | wc -l | awk '{exit($1 > 0)}'
fi
if [ "${{ matrix.example }}" = "ping" ]; then
! grep "WARN" ./output.log
fi
if [ "${{ matrix.example }}" = "dev_random" ]; then
! grep "WARN" ./output.log
fi
if [ "${{ matrix.example }}" = "ping_queue" ]; then
! grep "WARN" ./output.log
fi
if [ "${{ matrix.example }}" = "redirect_stdio" ]; then
grep "WARN" ./output.log || true
grep "WARN" ./output.log | wc -l | awk '{exit($1 > 0)}'
fi

0 comments on commit dcd9852

Please sign in to comment.