Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Windows nightly ci #32

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b8f5a93
initial commit
midays Nov 13, 2024
e8f0217
Merge remote-tracking branch 'origin/windows-nightly-ci' into windows…
midays Nov 19, 2024
18766e6
initial commit
midays Nov 19, 2024
9e13fb6
added execute tests command
midays Nov 19, 2024
7f1e8f9
fixed wrong name
midays Nov 19, 2024
3badd74
changed github token secret name to GH_RUNNER_API_TOKEN
midays Nov 19, 2024
96034ef
install vscode script
midays Nov 19, 2024
d800015
run `remove-ec2-runner` even if the run-tests failed
midays Nov 19, 2024
a700c01
fix token name
midays Nov 19, 2024
600267d
change script
midays Nov 19, 2024
0d3d3a2
change script again
midays Nov 21, 2024
1eaa307
add shell specification
midays Nov 21, 2024
8e7c2b2
try different installation way
midays Nov 21, 2024
6ecd9eb
added max retries
midays Nov 21, 2024
ef106ab
install winget and try to use it to install vscode
midays Nov 21, 2024
5ee2b32
remove winget installation, assuming vscode is already installed
midays Nov 23, 2024
f7f2720
print the env variable name to test if vscode is found and recognizab…
midays Nov 23, 2024
d8a0863
change pwsh to powershell
midays Nov 24, 2024
70af6f4
don't remove the vm [temp, will be removed manually, to test vscode i…
midays Nov 24, 2024
d913f77
Revert "don't remove the vm [temp, will be removed manually, to test …
midays Nov 24, 2024
c7c4e45
don't remove the vm [temp, will be removed manually, to test vscode i…
midays Nov 24, 2024
c45068a
stop instance after use, do initial installation
midays Nov 24, 2024
c889e5b
move installation
midays Nov 24, 2024
a0e3ade
Revert "move installation"
midays Nov 24, 2024
a549029
move installation
midays Nov 24, 2024
a2e23c1
verify env path
midays Nov 24, 2024
fe8dac1
Add VSCode to PATH
midays Nov 24, 2024
e42b759
check if installing vscode has affects
midays Nov 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/windows-nightly-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Provision Windows VM using reusable workflow

on: [push]

jobs:
run-provisioner-workflow:
uses: ./.github/workflows/provision-runner.yml
with:
ec2-image-id: ami-0b7d4973163feb944
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 }}

run-tests:
needs: run-provisioner-workflow
runs-on: ${{ needs.run-provisioner-workflow.outputs.instance_label }}
steps:

- name: Install Visual Studio Code
shell: powershell
run: |
$InstallerPath = "C:\vscode-installer.exe"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@midays The VM should have vscode installed on it . @msajidmansoori12 Please correct me if I am wrong .
We don't have to install vscode on it .

$Uri = "https://update.code.visualstudio.com/latest/win32-x64-user/stable"
$RetryCount = 0
$MaxRetries = 3
$Success = $false

while (-not $Success -and $RetryCount -lt $MaxRetries) {
try {
Invoke-WebRequest -Uri $Uri -OutFile $InstallerPath -TimeoutSec 60
$Success = $true
} catch {
$RetryCount++
Write-Output "Download failed. Retry $RetryCount of $MaxRetries..."
Start-Sleep -Seconds 10
}
}
if (-not $Success) {
throw "Failed to download VSCode installer after $MaxRetries attempts."
}

- name: Check VSCode installation
shell: powershell
run: code --version

- name: Clone kai-ci repo
run: |
mkdir ./kai-ci-temp
cd ./kai-ci-temp
git clone https://github.com/konveyor/kai-ci.git
cd kai-ci

- name: Install npm dependencies
run: |
npm install .

- name: Run tests
run: |
npx playwright test

remove-ec2-runner:
needs: [ run-provisioner-workflow,run-tests ]
if: always()
uses: ./.github/workflows/remove-runner.yml
with:
ec2-instance-id: ${{ needs.run-provisioner-workflow.outputs.ec2-instance-id }}
ec2-runner-label: ${{ needs.run-provisioner-workflow.outputs.instance_label }}
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 }}
Loading