From d4fe5d8f15bc18185f814cd36ef191b163c71cb7 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Tue, 16 May 2023 15:37:14 +0000 Subject: [PATCH] ci: do not keep ssh connection --- .github/workflows/e2e.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f2d708f..feb07a5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -99,12 +99,32 @@ jobs: scp .out-of-tree.toml script.sh user@$IP: - ssh user@$IP "out-of-tree --log-level=debug kernel list-remote --distro=${{ matrix.os.distro }} --ver=${{ matrix.os.release }}" - ssh user@$IP "out-of-tree --log-level=debug kernel autogen --max=1 --shuffle" - ssh user@$IP "out-of-tree --log-level=debug pew --qemu-timeout=10m" + echo '[Unit]' >> test.service + echo 'Description=e2e' >> test.service + echo '[Service]' >> test.service + echo 'User=user' >> test.service + echo 'RemainAfterExit=yes >> test.service + echo 'Type=oneshot' >> test.service + echo 'WorkingDirectory=/home/user' >> test.service + echo 'TimeoutStopSec=1' >> test.service + echo 'ExecStart=/usr/local/bin/out-of-tree kernel autogen --distro=${{ matrix.os.distro }} --ver=${{ matrix.os.release }}' >> test.service + echo 'ExecStart=/usr/local/bin/out-of-tree pew' >> test.service + + scp test.service root@$IP:/etc/systemd/system/test.service + + ssh root@$IP systemctl daemon-reload + + ssh root@$IP systemctl start test --no-block + + while ! ssh root@$IP systemctl show test -p SubState --value | grep -E '(failed|exited)' + do + sleep 30s + done scp -r user@$IP:.out-of-tree/logs . + ssh root@$IP systemctl is-active test + - name: Archive logs if: always() uses: actions/upload-artifact@v3