ci: add windows-test job that runs commands inside the testing VM via SSH
This commit is contained in:
parent
81873ebf42
commit
202798219d
1 changed files with 46 additions and 1 deletions
|
|
@ -1,8 +1,14 @@
|
|||
name: CI Test
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [main, windows-ci]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
WIN_HOST: 172.17.0.1
|
||||
WIN_PORT: 2210
|
||||
WIN_USER: edr
|
||||
|
||||
jobs:
|
||||
hello:
|
||||
runs-on: docker
|
||||
|
|
@ -15,3 +21,42 @@ jobs:
|
|||
node --version
|
||||
- name: Math check
|
||||
run: echo "2+2 = $((2+2))"
|
||||
|
||||
windows-test:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Install sshpass
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq sshpass openssh-client
|
||||
|
||||
- name: Wait for Windows VM SSH
|
||||
env:
|
||||
SSHPASS: ${{ secrets.WINDOWS_SSH_PASSWORD }}
|
||||
run: |
|
||||
for i in $(seq 1 30); do
|
||||
if sshpass -e ssh -o StrictHostKeyChecking=no -o ConnectTimeout=3 \
|
||||
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" "exit" 2>/dev/null; then
|
||||
echo "VM SSH ready"; exit 0
|
||||
fi
|
||||
echo "[$i/30] waiting for VM..."; sleep 5
|
||||
done
|
||||
echo "VM SSH never became ready"; exit 1
|
||||
|
||||
- name: Smoke test on Windows
|
||||
env:
|
||||
SSHPASS: ${{ secrets.WINDOWS_SSH_PASSWORD }}
|
||||
run: |
|
||||
sshpass -e ssh -o StrictHostKeyChecking=no \
|
||||
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \
|
||||
"whoami && ver && echo windows-smoke-ok"
|
||||
|
||||
# The actual test step — runs the test inside the Windows VM.
|
||||
# Customise the command to fit the project once Windows test tooling is in place.
|
||||
- name: Run Windows test
|
||||
env:
|
||||
SSHPASS: ${{ secrets.WINDOWS_SSH_PASSWORD }}
|
||||
run: |
|
||||
sshpass -e ssh -o StrictHostKeyChecking=no \
|
||||
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \
|
||||
"echo TODO: run actual test command here"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue