Update gpt to 4 #230
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] | |
jobs: | |
test: | |
# Make sure that everything works on the newest Ubuntu. | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Cache Cargo | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
cache-all-crates: true | |
cache-on-failure: true | |
- name: Install qemu | |
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends qemu-system-x86 | |
- name: Enable KVM group perms | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ | |
- name: Run tests | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: test | |
args: --package tests | |
build: | |
# Applications linked against glibc only work on that version of glibc | |
# (or newer ones), so this is effectively the oldest version the release | |
# is going to run on. | |
# In theory, this should be the oldest supported version of Ubuntu | |
# according to <https://github.com/actions/runner-images#available-images>, | |
# but Ubuntu 20.04 has OpenSSL 1.1 which newer ones don't have, so we need | |
# to go with at least 22.04. | |
runs-on: ubuntu-22.04 | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Cache Cargo | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
cache-all-crates: true | |
cache-on-failure: true | |
- name: Build for i686 | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: build | |
args: --package towboot --target i686-unknown-uefi | |
- name: Upload i686 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: towboot-debug-i686.efi | |
path: target/i686-unknown-uefi/debug/towboot.efi | |
- name: Build for x86_64 | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: build | |
args: --package towboot --target x86_64-unknown-uefi | |
- name: Upload x86_64 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: towboot-debug-x86_64.efi | |
path: target/x86_64-unknown-uefi/debug/towboot.efi | |
- name: Build towbootctl for x86_64-linux | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: build | |
args: --package towbootctl --target x86_64-unknown-linux-gnu --features=binary | |
- name: Upload x86_64-linux artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: towbootctl-debug-x86_64-linux | |
path: target/x86_64-unknown-linux-gnu/debug/towbootctl | |
- name: Install compiler for x86_64-windows | |
run: sudo apt-get update && sudo apt-get install gcc-mingw-w64-x86-64-win32 | |
- name: Install Rust for x86_64-windows | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: x86_64-pc-windows-gnu | |
- name: Build towbootctl for x86_64-windows | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: build | |
args: --package towbootctl --target x86_64-pc-windows-gnu --features=binary | |
- name: Upload x86_64-windows artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: towbootctl-debug-x86_64-windows.exe | |
path: target/x86_64-pc-windows-gnu/debug/towbootctl.exe | |
build-mac: | |
# We could cross-compile from Linux instead, | |
# but we'd still need the Xcode Command Line Tools. | |
# Downloading them requires logging in with an Apple ID, | |
# which is not possible in the CI. The macOS runners include it. | |
runs-on: macos-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust for x86_64-apple and aarch64-apple | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: x86_64-apple-darwin, aarch64-apple-darwin | |
- name: Cache Cargo | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
cache-all-crates: true | |
cache-on-failure: true | |
- name: Build towbootctl for x86_64-apple | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: build | |
args: --package towbootctl --target x86_64-apple-darwin --features=binary | |
- name: Build towbootctl for aarch64-apple | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: build | |
args: --package towbootctl --target aarch64-apple-darwin --features=binary | |
- name: Build universal binary for macOS | |
run: mkdir -p target/apple-darwin/debug && lipo -create -output target/apple-darwin/debug/towbootctl target/x86_64-apple-darwin/debug/towbootctl target/aarch64-apple-darwin/debug/towbootctl | |
- name: Upload apple artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: towbootctl-debug-macos | |
path: target/apple-darwin/debug/towbootctl |