Skip to content

Commit

Permalink
Test-Workflows for Hyper-V action
Browse files Browse the repository at this point in the history
  • Loading branch information
norschel authored Nov 4, 2023
1 parent b1a3936 commit 1d65312
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/HyperVActionRemotePowerShellTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This is a basic workflow to help you get started with Actions

name: HyperVActionRemotePowerShellTest

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
#push:
# branches: [ main ]
#pull_request:
# branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: [self-hosted]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- uses: ./
name: Hyper-V - StartVM
with:
hostname: localhost

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
vmname: win11test
command: StartVM
startvmstatuscheckType: WaitingTime
startvmwaittimebasedcheckinterval: 15
- uses: ./
name: Hyper-V - Create Checkpoint
with:
hostname: localhost

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
vmname: win11test
command: createcheckpoint
checkpointname: GitHubTest
- uses: ./
name: Hyper-V - StopVM
with:
hostname: localhost

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
vmname: win11test
command: ShutdownVM
startvmstatuschecktype: WaitingTime
startvmwaittimebasedcheckinterval: 15
- uses: ./
name: Hyper-V - Remove Checkpoint
with:
hostname: localhost

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
vmname: win11test
command: removecheckpoint
checkpointname: GitHubTest
76 changes: 76 additions & 0 deletions .github/workflows/HyperVActionSSHModeTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This is a basic workflow to help you get started with Actions

name: HyperVActionSSHModeTest

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
#push:
# branches: [ main ]
#pull_request:
# branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: [self-hosted]
env:
sshhost: localhost

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
vmname: win11test
hostname: localhost

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: ./
name: Hyper-V - StartVM
with:
hostname: ${{ env.hostname }}
vmname: ${{ env.vmname }}
command: StartVM
startvmstatuschecktype: WaitingTime
startvmwaittimebasedcheckinterval: 15
sshmode: true
sshhostname: ${{ env.sshhost }}
sshusername: ${{ secrets.sshusername }}
sshpassword: ${{ secrets.sshpassword }}
- uses: ./
name: Hyper-V - Create Checkpoint
with:
hostname: ${{ env.hostname }}
vmname: ${{ env.vmname }}
command: createcheckpoint
checkpointname: GitHubTest
sshmode: true
sshhostname: ${{ env.sshhost }}
sshusername: ${{ secrets.sshusername }}
sshpassword: ${{ secrets.sshpassword }}
- uses: ./
name: Hyper-V - StopVM
with:
hostname: ${{ env.hostname }}
vmname: ${{ env.vmname }}
command: ShutdownVM
startvmstatuschecktype: WaitingTime
startvmwaittimebasedcheckinterval: 15
sshmode: true
sshhostname: ${{ env.sshhost }}
sshusername: ${{ secrets.sshusername }}
sshpassword: ${{ secrets.sshpassword }}
- uses: ./
name: Hyper-V - Remove Checkpoint
with:
hostname: ${{ env.hostname }}
vmname: ${{ env.vmname }}
command: removecheckpoint
checkpointname: GitHubTest
sshmode: true
sshhostname: ${{ env.sshhost }}
sshusername: ${{ secrets.sshusername }}
sshpassword: ${{ secrets.sshpassword }}

0 comments on commit 1d65312

Please sign in to comment.