This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
# PACKER_LOG: "1" | |
jobs: | |
x86_64: | |
runs-on: [self-hosted, X64, parallels] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- debian-11 | |
- debian-12 | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
provider: | |
- parallels-iso | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
# - name: Setup Packer | |
# uses: hashicorp/setup-packer@main | |
# with: | |
# version: latest | |
- name: Bento build | |
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/ | |
cat builds/${{ matrix.os }}*-x86_64._metadata.json | |
- 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/*.box | |
builds/*.json | |
retention-days: 10 | |
compression-level: 0 # no compression | |
- name: Bento Test | |
run: | | |
eval "$(chef shell-init bash)" | |
bento test |