Skip to content

Commit 2b80f1c

Browse files
authored
setup workflow for hosted runners (#1547)
* setup workflow for hosted runners
1 parent 036e8d1 commit 2b80f1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+567
-228
lines changed

Diff for: .github/workflows/ci-build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ jobs:
9595
allowed-failures:
9696
allowed-skips: ${{ toJSON(needs) }}
9797
jobs: ${{ toJSON(needs) }}
98+
99+
# pkr-bld-parallels-test:
100+
# uses: ./.github/workflows/test-pkr-bld-parallels.yml
101+
# secrets: inherit

Diff for: .github/workflows/pkr-bld-amazonlinux-x64.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
env:
66
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
7+
# PACKER_LOG: "1"
88

99
jobs:
1010
x86_64:
@@ -28,6 +28,8 @@ jobs:
2828
vagrant --version
2929
- name: Install Chef
3030
uses: actionshub/[email protected]
31+
with:
32+
version: 24.2.1058
3133
- name: Setup Packer
3234
uses: hashicorp/setup-packer@main
3335
with:
@@ -46,6 +48,7 @@ jobs:
4648
sudo chmod -R 777 /mnt/builds
4749
sudo ln -s /mnt/builds ./
4850
eval "$(chef shell-init bash)"
51+
export LOGNAME=$USER
4952
./${{ matrix.os }}-x86_64-virtualbox-build.sh
5053
ls -alh builds
5154
cat builds/${{ matrix.os }}*-x86_64._metadata.json
@@ -61,4 +64,5 @@ jobs:
6164
- name: Bento Test
6265
run: |
6366
eval "$(chef shell-init bash)"
67+
export LOGNAME=$USER
6468
bento test

Diff for: .github/workflows/pkr-bld-hyperv-x64.yml

+29-19
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,25 @@ on:
44

55
env:
66
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
7+
# PACKER_LOG: "1"
88

99
jobs:
1010
x86_64:
11-
runs-on: [self-hosted, X64, hyperv]
11+
runs-on: windows-latest
1212
strategy:
1313
fail-fast: false
1414
matrix:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
23-
- fedora-38
2421
- fedora-39
22+
- fedora-40
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8
@@ -38,20 +35,29 @@ jobs:
3835
steps:
3936
- name: Checkout
4037
uses: actions/checkout@main
41-
# - name: Setup Packer
42-
# uses: hashicorp/setup-packer@main
43-
# with:
44-
# version: latest
45-
- name: Bento build
46-
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
47-
- name: Remove VM in case of canceled job
48-
if: cancelled()
38+
- name: Install Chef
39+
uses: actionshub/[email protected]
40+
with:
41+
version: 24.2.1058
42+
- name: Setup Packer
43+
uses: hashicorp/setup-packer@main
44+
with:
45+
version: latest
46+
- name: Install Bento
4947
run: |
50-
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
51-
Stop-VM -Force ${{ matrix.os }}*-amd64
52-
sleep 1
53-
Remove-VM -Force ${{ matrix.os }}*-amd64
54-
sleep 2
48+
chef shell-init powershell
49+
gem build bento.gemspec
50+
gem install bento-*.gem
51+
- name: Create VM Switch for Hyper-V
52+
shell: pwsh
53+
run: |
54+
Get-PsDrive -PsProvider FileSystem
55+
pwd
56+
New-VMSwitch -Name "bento" -NetAdapterName "Ethernet" -AllowManagementOS $true
57+
- name: Packer Init
58+
run: packer init -upgrade packer_templates
59+
- name: Packer build
60+
run: packer build -timestamp-ui -only="${{ matrix.provider }}.vm" -var 'sources_enabled=["hyperv-iso.vm"]' -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
5561
- name: Upload build artifact
5662
uses: actions/upload-artifact@main
5763
with:
@@ -61,3 +67,7 @@ jobs:
6167
builds/*.json
6268
retention-days: 10
6369
compression-level: 0 # no compression
70+
- name: Bento Test
71+
run: |
72+
chef shell-init powershell
73+
bento test

Diff for: .github/workflows/pkr-bld-parallels-arm64.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
env:
66
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
7+
# PACKER_LOG: "1"
88

99
jobs:
1010
aarch64:
@@ -15,8 +15,6 @@ jobs:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
@@ -25,7 +23,6 @@ jobs:
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8

Diff for: .github/workflows/pkr-bld-parallels-x64.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
env:
66
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
7+
# PACKER_LOG: "1"
88

99
jobs:
1010
x86_64:
@@ -15,8 +15,6 @@ jobs:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
@@ -25,7 +23,6 @@ jobs:
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8

Diff for: .github/workflows/pkr-bld-qemu-arm64.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ env:
88

99
jobs:
1010
aarch64:
11-
runs-on: macos-14
11+
runs-on: macos-latest
1212
strategy:
1313
fail-fast: false
1414
matrix:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
@@ -25,7 +23,6 @@ jobs:
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8
@@ -40,13 +37,17 @@ jobs:
4037
uses: actions/checkout@main
4138
- name: Install Vagrant QEMU
4239
run: |
43-
brew install qemu libvirt
4440
brew tap hashicorp/tap
41+
brew update
42+
brew install qemu
43+
brew install libvirt
4544
brew install --cask hashicorp/tap/hashicorp-vagrant
4645
brew services start libvirt
4746
vagrant plugin install vagrant-libvirt vagrant-qemu
4847
- name: Install Chef
4948
uses: actionshub/[email protected]
49+
with:
50+
version: 24.2.1058
5051
- name: Setup Packer
5152
uses: hashicorp/setup-packer@main
5253
with:

Diff for: .github/workflows/pkr-bld-qemu-x64.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
env:
66
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
7+
# PACKER_LOG: "1"
88

99
jobs:
1010
x86_64:
@@ -15,8 +15,6 @@ jobs:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
@@ -25,7 +23,6 @@ jobs:
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8
@@ -38,14 +35,13 @@ jobs:
3835
steps:
3936
- name: Checkout
4037
uses: actions/checkout@main
41-
- name: Install Vagrant and kvm
38+
- name: Install Vagrant QEMU
4239
run: |
4340
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
4441
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
4542
sudo apt-get update
4643
sudo apt-get install -y software-properties-common vagrant qemu-kvm libvirt-daemon-system virtinst libvirt-clients bridge-utils qemu-utils libvirt-dev
4744
vagrant plugin install vagrant-libvirt vagrant-qemu
48-
vagrant --version
4945
- name: Enable KVM
5046
run: |
5147
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
@@ -58,6 +54,8 @@ jobs:
5854
sudo systemctl status libvirtd
5955
- name: Install Chef
6056
uses: actionshub/[email protected]
57+
with:
58+
version: 24.2.1058
6159
- name: Setup Packer
6260
uses: hashicorp/setup-packer@main
6361
with:

Diff for: .github/workflows/pkr-bld-virtualbox-arm64.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ on:
44

55
env:
66
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
7+
# PACKER_LOG: "1"
88

99
jobs:
1010
aarch64:
11-
runs-on: macos-14
11+
runs-on: macos-latest
1212
strategy:
1313
fail-fast: false
1414
matrix:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
@@ -25,7 +23,6 @@ jobs:
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8
@@ -41,12 +38,13 @@ jobs:
4138
- name: Install Vagrant Virtualbox
4239
run: |
4340
brew tap hashicorp/tap
41+
brew update
4442
brew install --cask hashicorp/tap/hashicorp-vagrant
45-
wget -q https://www.virtualbox.org/download/testcase/VirtualBox-7.0.15_BETA4-162549-macOSArm64.dmg
46-
hdiutil attach VirtualBox-7.0.15_BETA4-162549-macOSArm64.dmg
47-
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg -target /
43+
brew install --cask virtualbox@beta
4844
- name: Install Chef
4945
uses: actionshub/[email protected]
46+
with:
47+
version: 24.2.1058
5048
- name: Setup Packer
5149
uses: hashicorp/setup-packer@main
5250
with:

Diff for: .github/workflows/pkr-bld-virtualbox-x64.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
workflow_call:
44

55
env:
6-
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7-
PACKER_LOG: "1"
6+
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7+
# PACKER_LOG: 1
88

99
jobs:
1010
x86_64:
@@ -15,8 +15,6 @@ jobs:
1515
os:
1616
- almalinux-8
1717
- almalinux-9
18-
- centos-7
19-
- centos-stream-8
2018
- centos-stream-9
2119
- debian-11
2220
- debian-12
@@ -25,7 +23,6 @@ jobs:
2523
- freebsd-13
2624
- freebsd-14
2725
- opensuse-leap-15
28-
- oraclelinux-7
2926
- oraclelinux-8
3027
- oraclelinux-9
3128
- rockylinux-8
@@ -38,18 +35,18 @@ jobs:
3835
steps:
3936
- name: Checkout
4037
uses: actions/checkout@main
41-
- name: Install Vagrant and VirtualBox
38+
- name: Install Vagrant VirtualBox
4239
run: |
4340
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
4441
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/oracle-virtualbox-2016.gpg
4542
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
4643
echo "deb [signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
4744
sudo apt-get update
4845
sudo apt-get install -y software-properties-common vagrant virtualbox-7.0
49-
VBoxManage --version
50-
vagrant --version
5146
- name: Install Chef
5247
uses: actionshub/[email protected]
48+
with:
49+
version: 24.2.1058
5350
- name: Setup Packer
5451
uses: hashicorp/setup-packer@main
5552
with:
@@ -66,6 +63,7 @@ jobs:
6663
sudo chmod -R 777 /mnt/builds
6764
sudo ln -s /mnt/builds ./
6865
eval "$(chef shell-init bash)"
66+
export LOGNAME=$USER
6967
bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl"
7068
ls -alh builds/
7169
cat builds/${{ matrix.os }}*-x86_64._metadata.json
@@ -81,4 +79,5 @@ jobs:
8179
- name: Bento Test
8280
run: |
8381
eval "$(chef shell-init bash)"
82+
export LOGNAME=$USER
8483
bento test

0 commit comments

Comments
 (0)