Skip to content

Windows testing

Windows testing #28

Workflow file for this run

name: Windows Nightly Run
on: [push]
jobs:
# start-ec2-instance:
# uses: ./.github/workflows/provision-runner.yml
# with:
# ec2-image-id: ami-0cf05b9bbda99aed3
# ec2-instance-type: t2.micro
# security-group-id: sg-0a3e6b53e86d0e69d
# subnet-id: subnet-06113672589e7e836
# ec2-os-type: windows
# secrets:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# github-token: ${{ secrets.GH_RUNNER_API_TOKEN }}
# nonadmin-password: ${{ secrets.NONADMIN_PASSWORD }}
install-nodejs-as-admin:
# needs: start-ec2-instance
runs-on: ofi6i
steps:
- name: Install Node.js
run: choco install nodejs -y
shell: powershell
run-test-as-nonadmin:
runs-on: ubuntu-latest
steps:
- name: Install sshpass
run: sudo apt-get install -y sshpass
- name: Create batch file with repository cloning and hostname
run: |
sshpass -p "pass123!" ssh -o StrictHostKeyChecking=no ${EC2_USER}@${EC2_HOST} 'powershell -Command "
echo hostname > C:\\Users\\nonadmin\\clone-repo.bat;
echo set nodePath=C:\Program Files\nodejs > C:\\Users\\nonadmin\\clone-repo.bat;
echo set PATH=%PATH%;%nodePath% > C:\\Users\\nonadmin\\clone-repo.bat;
echo git clone https://github.com/konveyor/kai-ci C:\\Users\\nonadmin\\kai-ci >> C:\\Users\\nonadmin\\clone-repo.bat;
echo cd C:\\Users\\nonadmin\\kai-ci >> C:\\Users\\nonadmin\\clone-repo.bat;
echo npm install >> C:\\Users\\nonadmin\\clone-repo.bat;
echo npm ci >> C:\\Users\\nonadmin\\clone-repo.bat;
echo copy .env.example .env >> C:\\Users\\nonadmin\\clone-repo.bat;
echo npx playwright test >> C:\\Users\\nonadmin\\clone-repo.bat
"'
env:
EC2_USER: nonadmin
EC2_HOST: ec2-52-90-29-139.compute-1.amazonaws.com
EC2_PASSWORD: pass123!
- name: Clone repository on EC2 Windows instance using SSH password
run: |
sshpass -p "pass123!" ssh -o StrictHostKeyChecking=no ${EC2_USER}@${EC2_HOST} 'powershell -Command "Start-Process -FilePath C:\\Users\\nonadmin\\clone-repo.bat -NoNewWindow -Wait"'
env:
EC2_USER: nonadmin
EC2_HOST: ec2-52-90-29-139.compute-1.amazonaws.com
EC2_PASSWORD: pass123!