Workflow file for this run
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: | ||
workflow_call: | ||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
# PACKER_LOG: "1" | ||
jobs: | ||
x86_64: | ||
runs-on: macos-13 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- almalinux-8 | ||
- almalinux-9 | ||
- centos-7 | ||
- centos-stream-8 | ||
- centos-stream-9 | ||
- debian-11 | ||
- debian-12 | ||
- fedora-39 | ||
- fedora-40 | ||
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
- rockylinux-9 | ||
- ubuntu-20.04 | ||
- ubuntu-22.04 | ||
- ubuntu-24.04 | ||
provider: | ||
- vmware-iso | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
- name: Install Vagrant VMware-fusion | ||
run: | | ||
brew tap hashicorp/tap | ||
brew update | ||
brew install --cask hashicorp/tap/hashicorp-vagrant | ||
brew install --cask vmware-fusion | ||
brew install --cask vagrant-vmware-utility | ||
vagrant install vagrant-vmware-desktop | ||
cat <<EOF > /Library/Preferences/VMware\ Fusion/networking | ||
VERSION=1,0 | ||
answer VNET_1_DHCP yes | ||
answer VNET_1_DHCP_CFG_HASH 97D56988968565698E051056ADEDEEACF00F5981 | ||
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0 | ||
answer VNET_1_HOSTONLY_SUBNET 172.16.252.0 | ||
answer VNET_1_HOSTONLY_UUID 74A7B7F5-AB8E-41CF-9E0F-595F9C9FA1C5 | ||
answer VNET_1_VIRTUAL_ADAPTER yes | ||
answer VNET_8_DHCP yes | ||
answer VNET_8_DHCP_CFG_HASH 2040265D0F7053A921FB3F6EDE944490D9E687D6 | ||
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0 | ||
answer VNET_8_HOSTONLY_SUBNET 172.16.38.0 | ||
answer VNET_8_HOSTONLY_UUID 3CBAC6B3-6A71-4182-8BC6-849058A947B8 | ||
answer VNET_8_NAT yes | ||
answer VNET_8_VIRTUAL_ADAPTER yes | ||
EOF | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
with: | ||
version: 24.2.1058 | ||
- 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 | ||
- 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: | | ||
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64 | ||
vmrun -T fusion stop builds/packer-${{ matrix.os }}*-x86_64-vmware/${{ matrix.os }}*-amd64.vmx hard 2> /dev/null | ||
sleep 1 | ||
vmrun -T fusion deleteVM builds/packer-${{ matrix.os }}*-x86_64-vmware/${{ matrix.os }}*-amd64.vmx 2> /dev/null | ||
sleep 2 | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ matrix.os }}-vmware-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 |