-
Notifications
You must be signed in to change notification settings - Fork 5
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
midays
wants to merge
28
commits into
main
Choose a base branch
from
windows-nightly-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b8f5a93
initial commit
midays e8f0217
Merge remote-tracking branch 'origin/windows-nightly-ci' into windows…
midays 18766e6
initial commit
midays 9e13fb6
added execute tests command
midays 7f1e8f9
fixed wrong name
midays 3badd74
changed github token secret name to GH_RUNNER_API_TOKEN
midays 96034ef
install vscode script
midays d800015
run `remove-ec2-runner` even if the run-tests failed
midays a700c01
fix token name
midays 600267d
change script
midays 0d3d3a2
change script again
midays 1eaa307
add shell specification
midays 8e7c2b2
try different installation way
midays 6ecd9eb
added max retries
midays ef106ab
install winget and try to use it to install vscode
midays 5ee2b32
remove winget installation, assuming vscode is already installed
midays f7f2720
print the env variable name to test if vscode is found and recognizab…
midays d8a0863
change pwsh to powershell
midays 70af6f4
don't remove the vm [temp, will be removed manually, to test vscode i…
midays d913f77
Revert "don't remove the vm [temp, will be removed manually, to test …
midays c7c4e45
don't remove the vm [temp, will be removed manually, to test vscode i…
midays c45068a
stop instance after use, do initial installation
midays c889e5b
move installation
midays a0e3ade
Revert "move installation"
midays a549029
move installation
midays a2e23c1
verify env path
midays fe8dac1
Add VSCode to PATH
midays e42b759
check if installing vscode has affects
midays File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
$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 }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 .