diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b39b83613..10a648f83 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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 diff --git a/.github/workflows/test-pkr-bld-hyperv-x64.yml b/.github/workflows/test-pkr-bld-hyperv-x64.yml index 3b6140b11..27b939668 100644 --- a/.github/workflows/test-pkr-bld-hyperv-x64.yml +++ b/.github/workflows/test-pkr-bld-hyperv-x64.yml @@ -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 diff --git a/.github/workflows/test-pkr-bld-parallels-x64.yml b/.github/workflows/test-pkr-bld-parallels-x64.yml new file mode 100644 index 000000000..eee754937 --- /dev/null +++ b/.github/workflows/test-pkr-bld-parallels-x64.yml @@ -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