Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Corey Hemminger <[email protected]>
  • Loading branch information
Stromweld committed Apr 26, 2024
1 parent b9b5dd8 commit 4417f5a
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 87 deletions.
63 changes: 28 additions & 35 deletions .github/workflows/test-pkr-bld-hyperv-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,38 @@ jobs:
provider:
- hyperv-iso
steps:
# - name: Checkout
# uses: actions/checkout@main
# - name: iso-availability
# shell: pwsh
# run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"')
- name: Checkout
uses: actions/checkout@main
- name: tests
shell: pwsh
run: |
packer -v
# DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
$hyperv = Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online
# Check if Hyper-V is enabled
if($hyperv.State -eq "Enabled") {
Write-Host "Hyper-V is enabled."
} else {
Write-Host "Hyper-V is disabled."
}
Get-WindowsFeature
# - name: Packer Init
# run: packer init -upgrade packer_templates
# - name: Packer FMT
# run: packer fmt -check -recursive .
# - name: Packer Validate
# run: packer validate -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
# - name: Packer build
# run: packer build -timestamp-ui -only="${{ matrix.provider }}.vm" -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
# - name: Remove VM in case of canceled job
# if: cancelled()
# run: |
# echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
# Stop-VM -Force ${{ matrix.os }}*-amd64
# sleep 1
# Remove-VM -Force ${{ matrix.os }}*-amd64
# sleep 2
# - name: Upload build artifact
# uses: actions/upload-artifact@main
# with:
# name: "${{ matrix.os }}-hyperv-x86_64"
# path: |
# builds/*.box
# retention-days: 10
Write-Host "Hyper-V is $($hyperv.State)"
# # Check if Hyper-V is enabled
# if($hyperv.State -eq "Enabled") {
# Write-Host "Hyper-V is enabled."
# } else {
# Write-Host "Hyper-V is disabled."
# }
- name: Packer Init
run: packer init -upgrade packer_templates
- name: Packer build
run: packer build -timestamp-ui -only="${{ matrix.provider }}.vm" -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
- name: Remove VM in case of canceled job
if: cancelled()
run: |
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
Stop-VM -Force ${{ matrix.os }}*-amd64
sleep 1
Remove-VM -Force ${{ matrix.os }}*-amd64
sleep 2
- name: Upload build artifact
uses: actions/upload-artifact@main
with:
name: "${{ matrix.os }}-hyperv-x86_64"
path: |
builds/*.box
retention-days: 10
119 changes: 67 additions & 52 deletions .github/workflows/test-pkr-bld-parallels-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,81 @@ jobs:
fail-fast: false
matrix:
os:
# - almalinux-8
- almalinux-9
# - centos-7
# - centos-stream-8
# - centos-stream-9
# - debian-11
# - debian-12
# - fedora-38
# - fedora-39
# - freebsd-13
# - freebsd-14
# - opensuse-leap-15
# - oracle-7
# - oracle-8
# - oracle-9
# - rockylinux-8
# - rockylinux-9
# - ubuntu-20.04
# - ubuntu-22.04
# - ubuntu-23.10
provider:
- parallels-iso
- virtualbox-iso
- vmware-iso
- qemu
steps:
- name: Checkout
uses: actions/checkout@main
- name: Install Virtualization Software
run: |
brew install qemu libvirt
brew services start libvirt
brew install --cask parallels parallels-virtualization-sdk virtualbox vmware-fusion vagrant vagrant-vmware-utility
# - name: Packer Init
# run: packer init -upgrade packer_templates
# - name: Packer FMT
# run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi
# - name: Packer Validate
# run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
# - name: Packer build
## run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
# run: |
# eval "$(chef shell-init bash)"
# bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl"
# ls -alh builds
## - name: Bento Test
## run: |
## eval "$(chef shell-init bash)"
## bento test
# - name: Remove VM in case of canceled job
# if: cancelled()
# run: |
# VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)"
# echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
# prlctl stop "$VM" --kill 2> /dev/null
# sleep 1
# prlctl delete "$VM" 2> /dev/null
# sleep 2
# - name: Upload build artifact
# uses: actions/upload-artifact@v3
# with:
# name: "${{ matrix.os }}-parallels-x86_64"
# path: |
# builds
# !builds/uploaded/*
# retention-days: 10
- name: Install Chef
uses: actionshub/[email protected]
- name: Setup Packer
uses: hashicorp/setup-packer@main
with:
version: latest
- name: Install Bento
run: |
eval "$(chef shell-init bash)"
gem build bento.gemspec
gem install bento-*.gem
df -h
- name: Bento build
run: |
# rm -rf builds
# sudo mkdir -p /mnt/builds/iso
# sudo chmod -R 777 /mnt/builds
# sudo ln -s /mnt/builds ./
eval "$(chef shell-init bash)"
bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl"
ls -alh builds/
cat builds/${{ matrix.os }}*-x86_64._metadata.json

aarch64:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
os:
- almalinux-9
provider:
- parallels-iso
- vmware-iso
- qemu
steps:
- name: Checkout
uses: actions/checkout@main
- name: Install Virtualization Software
run: |
brew install qemu libvirt
brew services start libvirt
brew install --cask parallels parallels-virtualization-sdk vmware-fusion vagrant vagrant-vmware-utility
- name: Install Chef
uses: actionshub/[email protected]
- name: Setup Packer
uses: hashicorp/setup-packer@main
with:
version: latest
- name: Install Bento
run: |
eval "$(chef shell-init bash)"
gem build bento.gemspec
gem install bento-*.gem
df -h
- name: Bento build
run: |
# rm -rf builds
# sudo mkdir -p /mnt/builds/iso
# sudo chmod -R 777 /mnt/builds
# sudo ln -s /mnt/builds ./
eval "$(chef shell-init bash)"
bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl"
ls -alh builds/
cat builds/${{ matrix.os }}*-aarch64._metadata.json

0 comments on commit 4417f5a

Please sign in to comment.