From 1d653121f32d073604551f0c1015af4b564204e3 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Sat, 4 Nov 2023 21:59:06 +0100 Subject: [PATCH] Test-Workflows for Hyper-V action --- .../HyperVActionRemotePowerShellTest.yml | 57 ++++++++++++++ .github/workflows/HyperVActionSSHModeTest.yml | 76 +++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 .github/workflows/HyperVActionRemotePowerShellTest.yml create mode 100644 .github/workflows/HyperVActionSSHModeTest.yml diff --git a/.github/workflows/HyperVActionRemotePowerShellTest.yml b/.github/workflows/HyperVActionRemotePowerShellTest.yml new file mode 100644 index 0000000..43b92cc --- /dev/null +++ b/.github/workflows/HyperVActionRemotePowerShellTest.yml @@ -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 + vmname: win11test + command: StartVM + startvmstatuscheckType: WaitingTime + startvmwaittimebasedcheckinterval: 15 + - uses: ./ + name: Hyper-V - Create Checkpoint + with: + hostname: localhost + vmname: win11test + command: createcheckpoint + checkpointname: GitHubTest + - uses: ./ + name: Hyper-V - StopVM + with: + hostname: localhost + vmname: win11test + command: ShutdownVM + startvmstatuschecktype: WaitingTime + startvmwaittimebasedcheckinterval: 15 + - uses: ./ + name: Hyper-V - Remove Checkpoint + with: + hostname: localhost + vmname: win11test + command: removecheckpoint + checkpointname: GitHubTest diff --git a/.github/workflows/HyperVActionSSHModeTest.yml b/.github/workflows/HyperVActionSSHModeTest.yml new file mode 100644 index 0000000..c37020b --- /dev/null +++ b/.github/workflows/HyperVActionSSHModeTest.yml @@ -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 + vmname: win11test + hostname: localhost + # 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 }}