mirror of
https://github.com/ipxe/ipxe
synced 2026-01-27 18:46:05 +03:00
Using "git describe" to automatically construct the version number has caused more problems than it has solved. In particular, it causes errors when building from a shallow clone of the repository, which is a common scenario in modern automated build environments. Define the base version number (currently 1.21.1+) as a set of hardcoded constants within the Makefile, to be updated whenever a release is made. It is extremely useful to have the git commit ID present in the startup banner. End users tend to provide screenshots of failures, and having the commit ID printed at startup makes it trivial to identify which version of the code is in use. Identify the git version (if building from a git tree) by directly reading from .git/HEAD and associated files. This allows the git commit ID to potentially be included even if the build environment does not have the git tools installed. Use the default shallow clone in the GitHub Actions workflow, since we no longer require access to the full commit history. Signed-off-by: Michael Brown <mcb30@ipxe.org>
118 lines
3.6 KiB
YAML
118 lines
3.6 KiB
YAML
name: Build
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
|
|
cache:
|
|
name: Cache
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Cache permissions
|
|
run: |
|
|
sudo chown $(id -un) /var/cache/apt/archives
|
|
- name: Cache packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /var/cache/apt/archives/*.deb
|
|
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
|
|
restore-keys: |
|
|
apt-cache-
|
|
- name: Download packages
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y -d -o Acquire::Retries=50 \
|
|
mtools syslinux isolinux genisoimage \
|
|
libc6-dev-i386 liblzma-dev valgrind \
|
|
gcc-arm-none-eabi gcc-aarch64-linux-gnu
|
|
|
|
x86:
|
|
name: x86
|
|
runs-on: ubuntu-24.04
|
|
needs: cache
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
- name: Cache permissions
|
|
run: |
|
|
sudo chown $(id -un) /var/cache/apt/archives
|
|
- name: Cache packages
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: /var/cache/apt/archives/*.deb
|
|
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
|
|
- name: Install packages
|
|
run: |
|
|
sudo dpkg --add-architecture i386
|
|
sudo apt update
|
|
sudo apt install -y -o Acquire::Retries=50 \
|
|
mtools syslinux isolinux genisoimage \
|
|
libc6-dev-i386 liblzma-dev valgrind \
|
|
libgcc-s1:i386 libc6-dbg:i386
|
|
- name: Build (BIOS)
|
|
run: |
|
|
make -j 4 -C src
|
|
- name: Build (Everything)
|
|
run: |
|
|
make -j 4 -C src everything
|
|
- name: Test
|
|
run: |
|
|
valgrind ./src/bin-i386-linux/tests.linux
|
|
valgrind ./src/bin-x86_64-linux/tests.linux
|
|
|
|
arm32:
|
|
name: ARM32
|
|
runs-on: ubuntu-24.04
|
|
needs: cache
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
- name: Cache permissions
|
|
run: |
|
|
sudo chown $(id -un) /var/cache/apt/archives
|
|
- name: Cache packages
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: /var/cache/apt/archives/*.deb
|
|
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
|
|
- name: Install packages
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y -o Acquire::Retries=50 \
|
|
mtools syslinux isolinux genisoimage \
|
|
gcc-arm-none-eabi
|
|
- name: Build
|
|
run: |
|
|
make -j 4 -C src CROSS=arm-none-eabi- \
|
|
bin-arm32-efi/intel.efi \
|
|
bin-arm32-efi/intel.usb \
|
|
bin-arm32-efi/intel.iso
|
|
|
|
arm64:
|
|
name: ARM64
|
|
runs-on: ubuntu-24.04
|
|
needs: cache
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
- name: Cache permissions
|
|
run: |
|
|
sudo chown $(id -un) /var/cache/apt/archives
|
|
- name: Cache packages
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: /var/cache/apt/archives/*.deb
|
|
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
|
|
- name: Install packages
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y -o Acquire::Retries=50 \
|
|
mtools syslinux isolinux genisoimage \
|
|
gcc-aarch64-linux-gnu
|
|
- name: Build
|
|
run: |
|
|
make -j 4 -C src CROSS=aarch64-linux-gnu- \
|
|
bin-arm64-efi/ipxe.efi \
|
|
bin-arm64-efi/ipxe.usb \
|
|
bin-arm64-efi/ipxe.iso
|