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 Feb 3, 2024
1 parent 84645f9 commit 891c8a9
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
pkr-bld-hyper-v-x64:
uses: ./.github/workflows/test-pkr-bld-hyperv-x64.yml
secrets: inherit
pkr-bld-parallels-x64:
uses: ./.github/workflows/test-pkr-bld-parallels-x64.yml
secrets: inherit

# pkr-bld-amazonlinux-x64:
# uses: ./.github/workflows/pkr-bld-amazonlinux-x64.yml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-pkr-bld-hyperv-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- name: tests
shell: pwsh
run: |
Get-WindowsFeature
packer -v
$hyperv = Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online
# Check if Hyper-V is enabled
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/test-pkr-bld-parallels-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
on:
workflow_call:

env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

jobs:
x86_64:
runs-on: [self-hosted, X64, parallels]
strategy:
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
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: Install Virtualization Software
uses: ubuntu-latest
run: |
sudo apt-get update
sudo apt-get install -y parallels virtualbox qemu-kvm
- 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

0 comments on commit 891c8a9

Please sign in to comment.