Skip to content

Commit

Permalink
Windows testing
Browse files Browse the repository at this point in the history
Signed-off-by: Shveta Sachdeva <[email protected]>
  • Loading branch information
sshveta committed Jan 21, 2025
1 parent 9d47f1e commit a58940e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/windows_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,25 @@ jobs:
- name: Install sshpass
run: sudo apt-get install -y sshpass

- name: Create batch file locally
- name: Create batch file locally to git clone
run: |
echo "set nodePath=C:\Program Files\nodejs" > clone-repo.bat
echo "set PATH=%PATH%;%nodePath%" >> clone-repo.bat
echo "git clone https://github.com/konveyor/kai-ci C:\\Users\\nonadmin\\kai-ci" >> clone-repo.bat
echo "cd C:\\Users\\nonadmin\\kai-ci" >> clone-repo.bat
echo "npm install" >> clone-repo.bat
echo "copy .env.example .env" >> clone-repo.bat
echo "npx playwright test" >> clone-repo.bat
shell: bash

- name: Create batch file locally to execute tests
run: |
echo "copy .env.example .env" > execute-tests.bat
echo "npx playwright test" >> execute-tests.bat
shell: bash

- name: Copy batch file to Windows EC2 instance
run: |
sshpass -p ${EC2_PASSWORD} scp -o StrictHostKeyChecking=no clone-repo.bat ${EC2_USER}@${EC2_HOST}:C:\\Users\\nonadmin\\clone-repo.bat
sshpass -p ${EC2_PASSWORD} scp -o StrictHostKeyChecking=no execute-tests.bat ${EC2_USER}@${EC2_HOST}:C:\\Users\\nonadmin\\execute-tests.bat
env:
EC2_USER: nonadmin
EC2_HOST: ec2-52-90-29-139.compute-1.amazonaws.com
Expand All @@ -54,6 +59,7 @@ jobs:
- name: Execute batch file on EC2 Windows instance
run: |
sshpass -p ${EC2_PASSWORD} ssh -o StrictHostKeyChecking=no ${EC2_USER}@${EC2_HOST} 'powershell -Command "Start-Process -FilePath C:\\Users\\nonadmin\\clone-repo.bat -NoNewWindow -Wait"'
sshpass -p ${EC2_PASSWORD} ssh -o StrictHostKeyChecking=no ${EC2_USER}@${EC2_HOST} 'powershell -Command "Start-Process -FilePath C:\\Users\\nonadmin\\execute-tests.bat -NoNewWindow -Wait"'
env:
EC2_USER: nonadmin
EC2_HOST: ec2-52-90-29-139.compute-1.amazonaws.com
Expand Down

0 comments on commit a58940e

Please sign in to comment.