-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup workflow for hosted runners (#1547)
* setup workflow for hosted runners
- Loading branch information
Showing
42 changed files
with
567 additions
and
228 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
# PACKER_LOG: "1" | ||
|
||
jobs: | ||
x86_64: | ||
|
@@ -28,6 +28,8 @@ jobs: | |
vagrant --version | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
with: | ||
version: 24.2.1058 | ||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
|
@@ -46,6 +48,7 @@ jobs: | |
sudo chmod -R 777 /mnt/builds | ||
sudo ln -s /mnt/builds ./ | ||
eval "$(chef shell-init bash)" | ||
export LOGNAME=$USER | ||
./${{ matrix.os }}-x86_64-virtualbox-build.sh | ||
ls -alh builds | ||
cat builds/${{ matrix.os }}*-x86_64._metadata.json | ||
|
@@ -61,4 +64,5 @@ jobs: | |
- name: Bento Test | ||
run: | | ||
eval "$(chef shell-init bash)" | ||
export LOGNAME=$USER | ||
bento test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,28 +4,25 @@ on: | |
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
# PACKER_LOG: "1" | ||
|
||
jobs: | ||
x86_64: | ||
runs-on: [self-hosted, X64, hyperv] | ||
runs-on: windows-latest | ||
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 | ||
- fedora-40 | ||
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
|
@@ -38,20 +35,29 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
# - name: Setup Packer | ||
# uses: hashicorp/setup-packer@main | ||
# with: | ||
# version: latest | ||
- name: Bento build | ||
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 | ||
- name: Remove VM in case of canceled job | ||
if: cancelled() | ||
- 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: | | ||
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64 | ||
Stop-VM -Force ${{ matrix.os }}*-amd64 | ||
sleep 1 | ||
Remove-VM -Force ${{ matrix.os }}*-amd64 | ||
sleep 2 | ||
chef shell-init powershell | ||
gem build bento.gemspec | ||
gem install bento-*.gem | ||
- name: Create VM Switch for Hyper-V | ||
shell: pwsh | ||
run: | | ||
Get-PsDrive -PsProvider FileSystem | ||
pwd | ||
New-VMSwitch -Name "bento" -NetAdapterName "Ethernet" -AllowManagementOS $true | ||
- name: Packer Init | ||
run: packer init -upgrade packer_templates | ||
- name: Packer build | ||
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 | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@main | ||
with: | ||
|
@@ -61,3 +67,7 @@ jobs: | |
builds/*.json | ||
retention-days: 10 | ||
compression-level: 0 # no compression | ||
- name: Bento Test | ||
run: | | ||
chef shell-init powershell | ||
bento test |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,13 @@ env: | |
|
||
jobs: | ||
aarch64: | ||
runs-on: macos-14 | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- almalinux-8 | ||
- almalinux-9 | ||
- centos-7 | ||
- centos-stream-8 | ||
- centos-stream-9 | ||
- debian-11 | ||
- debian-12 | ||
|
@@ -25,7 +23,6 @@ jobs: | |
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
|
@@ -40,13 +37,17 @@ jobs: | |
uses: actions/checkout@main | ||
- name: Install Vagrant QEMU | ||
run: | | ||
brew install qemu libvirt | ||
brew tap hashicorp/tap | ||
brew update | ||
brew install qemu | ||
brew install libvirt | ||
brew install --cask hashicorp/tap/hashicorp-vagrant | ||
brew services start libvirt | ||
vagrant plugin install vagrant-libvirt vagrant-qemu | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
with: | ||
version: 24.2.1058 | ||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
# PACKER_LOG: "1" | ||
|
||
jobs: | ||
x86_64: | ||
|
@@ -15,8 +15,6 @@ jobs: | |
os: | ||
- almalinux-8 | ||
- almalinux-9 | ||
- centos-7 | ||
- centos-stream-8 | ||
- centos-stream-9 | ||
- debian-11 | ||
- debian-12 | ||
|
@@ -25,7 +23,6 @@ jobs: | |
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
|
@@ -38,14 +35,13 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
- name: Install Vagrant and kvm | ||
- name: Install Vagrant QEMU | ||
run: | | ||
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg | ||
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 | ||
sudo apt-get update | ||
sudo apt-get install -y software-properties-common vagrant qemu-kvm libvirt-daemon-system virtinst libvirt-clients bridge-utils qemu-utils libvirt-dev | ||
vagrant plugin install vagrant-libvirt vagrant-qemu | ||
vagrant --version | ||
- name: Enable KVM | ||
run: | | ||
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: | |
sudo systemctl status libvirtd | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
with: | ||
version: 24.2.1058 | ||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,17 @@ on: | |
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
# PACKER_LOG: "1" | ||
|
||
jobs: | ||
aarch64: | ||
runs-on: macos-14 | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- almalinux-8 | ||
- almalinux-9 | ||
- centos-7 | ||
- centos-stream-8 | ||
- centos-stream-9 | ||
- debian-11 | ||
- debian-12 | ||
|
@@ -25,7 +23,6 @@ jobs: | |
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
|
@@ -41,12 +38,13 @@ jobs: | |
- name: Install Vagrant Virtualbox | ||
run: | | ||
brew tap hashicorp/tap | ||
brew update | ||
brew install --cask hashicorp/tap/hashicorp-vagrant | ||
wget -q https://www.virtualbox.org/download/testcase/VirtualBox-7.0.15_BETA4-162549-macOSArm64.dmg | ||
hdiutil attach VirtualBox-7.0.15_BETA4-162549-macOSArm64.dmg | ||
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg -target / | ||
brew install --cask virtualbox@beta | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
with: | ||
version: 24.2.1058 | ||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ on: | |
workflow_call: | ||
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# PACKER_LOG: 1 | ||
|
||
jobs: | ||
x86_64: | ||
|
@@ -15,8 +15,6 @@ jobs: | |
os: | ||
- almalinux-8 | ||
- almalinux-9 | ||
- centos-7 | ||
- centos-stream-8 | ||
- centos-stream-9 | ||
- debian-11 | ||
- debian-12 | ||
|
@@ -25,7 +23,6 @@ jobs: | |
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
|
@@ -38,18 +35,18 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
- name: Install Vagrant and VirtualBox | ||
- name: Install Vagrant VirtualBox | ||
run: | | ||
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg | ||
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/oracle-virtualbox-2016.gpg | ||
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 | ||
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 | ||
sudo apt-get update | ||
sudo apt-get install -y software-properties-common vagrant virtualbox-7.0 | ||
VBoxManage --version | ||
vagrant --version | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
with: | ||
version: 24.2.1058 | ||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
|
@@ -66,6 +63,7 @@ jobs: | |
sudo chmod -R 777 /mnt/builds | ||
sudo ln -s /mnt/builds ./ | ||
eval "$(chef shell-init bash)" | ||
export LOGNAME=$USER | ||
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 | ||
|
@@ -81,4 +79,5 @@ jobs: | |
- name: Bento Test | ||
run: | | ||
eval "$(chef shell-init bash)" | ||
export LOGNAME=$USER | ||
bento test |
Oops, something went wrong.