Bump abbbi/github-actions-tune #99
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
--- | |
#name: loop-test2-build | |
on: | |
push: | |
# branches: [ master ] | |
#paths-ignore: | |
# - '.github/workflows/**' | |
paths: | |
- '!.github/workflows/**' | |
- '.github/workflows/loop-test2-build.yml' | |
workflow_dispatch: | |
inputs: | |
# clear-docker-cache: | |
# description: 'clear docker cache with rm -fr /tmp/.buildx-cache /tmp/.buildx-cache-old /tmp/.buildx-cache-new' | |
# required: false | |
# type: boolean | |
clear-ccache: | |
description: 'clear ccache cache with ccache clear' | |
required: false | |
type: boolean | |
make-everything: | |
description: 'make everything' | |
required: false | |
type: boolean | |
make-everything-arm: | |
description: 'make everything CROSS aarch64 linux gnu' | |
required: false | |
type: boolean | |
no-cache-save-apt: | |
description: 'disabel cache-save-apt save and restore' | |
required: false | |
type: boolean | |
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-secrets | |
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication | |
permissions: | |
packages: read | |
contents: read | |
jobs: | |
x86: | |
name: x86-loop-test | |
#runs-on: ubuntu-22.04 | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "github.event.inputs.no-cache-save-apt != 'true'" | |
if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
run: | | |
echo github.event.inputs.no-cache-save-apt | |
- name: "github.event.inputs.clear-ccache == 'false'" | |
if: ${{ github.event.inputs.clear-ccache == 'false' }} | |
run: | | |
echo github.event.inputs.clear-ccache | |
- name: "github.event.inputs.clear-ccache == 'true'" | |
if: ${{ github.event.inputs.clear-ccache == 'true' }} | |
run: | | |
echo github.event.inputs.clear-ccache | |
- name: "github.event.inputs.clear-ccache != 'false'" | |
if: ${{ github.event.inputs.clear-ccache != 'false' }} | |
run: | | |
echo github.event.inputs.clear-ccache | |
- name: "github.event.inputs.clear-ccache != 'true'" | |
if: ${{ github.event.inputs.clear-ccache != 'true' }} | |
run: | | |
echo github.event.inputs.clear-ccache | |
- name: "github.event.inputs.clear-ccache" | |
if: ${{ github.event.inputs.clear-ccache }} | |
run: | | |
echo github.event.inputs.clear-ccache | |
- name: "github.event.inputs.make-everything-arm" | |
if: ${{ github.event.inputs.make-everything-arm }} | |
run: | | |
echo github.event.inputs.make-everything-arm | |
- name: "github.event.inputs.make-everything-arm arm32" | |
if: ${{ github.event.inputs.make-everything-arm }} | |
run: | | |
echo github.event.inputs.make-everything-arm | |
- name: echo path | |
run: | | |
set -x | |
echo "$GITHUB_PATH" | |
echo "$PATH" | |
echo "############################" | |
env | |
echo "############################" | |
apt-config dump | |
- name: link eatmydata to make, add ccache to path, set MAKE_OPT with nproc | |
run: | | |
ln -s /usr/bin/eatmydata /usr/local/bin/make | |
#echo "$HOME/.local/bin" >> $GITHUB_PATH | |
echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH | |
echo "MAKE_OPT=-j $((`nproc`+0))" >> $GITHUB_ENV | |
###echo "MAKE_OPT2=-j 3" >> $GITHUB_ENV | |
###echo "MAKE_OPT3=$((`nproc`+0))" >> $GITHUB_ENV | |
echo "LSB_RELEASE_SC=$(lsb_release --short --codename)" >> $GITHUB_ENV | |
- name: Binary::apt::APT::Keep-Downloaded-Packages "true" /etc/apt/apt.conf.d/01keep-debs | |
if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
run: | | |
# https://superuser.com/questions/1405001/why-does-apt-do-not-store-downloaded-packages-anymore | |
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' | sudo tee /etc/apt/apt.conf.d/01keep-debs | |
#echo 'APT::Keep-Downloaded-Packages "true";' | sudo tee -a /etc/apt/apt.conf.d/01keep-debs | |
# - name: grep -R -v adfqefoo /etc/apt/* | |
# run: | | |
# grep -R -v adfqefoo /etc/apt/* | |
- name: echo path | |
run: | | |
set -x | |
echo "$GITHUB_PATH" | |
echo "$PATH" | |
echo "############################" | |
env | |
echo "############################" | |
apt-config dump | |
ls -lah /var/cache/apt/archives/*.deb | |
echo "${{ hashFiles('/var/cache/apt/archives/*.deb') }}" | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
repository: ipxe/ipxe | |
path: . | |
fetch-depth: 0 | |
#- uses: abbbi/github-actions-tune@v1 | |
- uses: abbbi/github-actions-tune@81fb919e588c20b7ab52b2cac097d2efd765c714 | |
- name: link eatmydata to make | |
run: | | |
if [ -a /usr/bin/eatmydata ] && [ !-e /usr/bin/eatmydata ]; then | |
ln -s /usr/bin/eatmydata /usr/local/bin/make | |
fi | |
# ln -s /usr/bin/eatmydata /usr/local/bin/make | |
- name: sudo chown --verbose "$USER:" /var/cache/apt/archives/*.deb | |
if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
run: | | |
set -x | |
sudo chown --verbose "$USER:" /var/cache/apt/archives | |
#sudo chown --verbose "$USER:" /var/cache/apt/archives/*.deb | |
# https://github.com/actions/cache#creating-a-cache-key | |
# http://man7.org/linux/man-pages/man1/date.1.html | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y%m%d_%H%M%S")" >> $GITHUB_OUTPUT | |
#echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: actions/cache/[email protected] | |
if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
id: cache-apt-restore | |
with: | |
path: "/var/cache/apt/archives/*.deb" | |
key: cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('/var/cache/apt/archives/*.deb') }} | |
restore-keys: | | |
cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('/var/cache/apt/archives/*.deb') }} | |
cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ steps.get-date.outputs.date }}- | |
cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}- | |
#key: cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ hashFiles('/var/cache/apt/archives/**.deb') }} | |
#key: cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ hashFiles('/var/cache/apt/archives/**.deb') }}-${{ steps.get-date.outputs.date }} | |
#key: cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ matrix.ghc }}-${{ matrix.os }}-${{ matrix.type }}-${{ hashFiles('/var/cache/apt/archives/**.deb') }} | |
- name: sudo chown --verbose "root:" /var/cache/apt/archives | |
if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
run: | | |
set -x | |
sudo chown --verbose "root:" /var/cache/apt/archives | |
# - uses: actions/cache@v3 | |
# id: cache-apt | |
# with: | |
# path: /var/cache/apt/archives/*.deb | |
# #key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }} | |
# restore-keys: cache-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ matrix.ghc }}-${{ matrix.os }}-${{ matrix.type }}- | |
# key: cache-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ matrix.ghc }}-${{ matrix.os }}-${{ matrix.type }}-${{ hashFiles('/var/cache/apt/archives/*.deb') }} | |
# #key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Install packages | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt update | |
sudo apt install -y -o Acquire::Retries=50 \ | |
--no-install-recommends \ | |
mtools syslinux isolinux \ | |
libc6-dev-i386 libc6-dbg:i386 valgrind \ | |
p7zip-full genisoimage mtools isolinux syslinux syslinux-efi syslinux-utils xorriso | |
- name: install ccache | |
uses: berlin4apk/[email protected] | |
with: | |
key: ${{ github.job }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.type }} | |
verbose: 2 # "Verbosity level: 0 (default), 1 or 2. Ignore for sccache." | |
max-size: 1000M # Max size of the cache, default: 500M | |
compression-level: 0 # ccache compression-level, ccache 3.7.7 uses gzip: a Normal value is 6 (0-9), ccache 3.7.7 uses zstd: a Normal value is 0 (-5-19) see https://ccache.dev/manual/4.6.html#config_compression_level | |
install-from-github: true | |
variant: ccache # 'Ccache variant to use. Either "ccache" (the default) or "sccache" (see https://github.com/mozilla/sccache)' | |
# save: false # If 'false', do not save the cache, only restore. default: true | |
# ccache-dir: "~/.ccache" | |
# dont-do-config: false | |
- name: run clear-ccache | |
#if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
if: ${{ github.event.inputs.clear-ccache == 'true' }} | |
run: | | |
set -x | |
ccache --show-config | |
ccache --show-compression --show-stats | |
ccache --verbose --clear | |
ccache --show-compression --show-stats | |
- name: run Build (Everything) pre build | |
#if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
if: ${{ github.event.inputs.make-everything == 'true'}} | |
run: | | |
make ${{ env.MAKE_OPT }} -C src | |
# export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
- name: run Build (Everything) full build | |
#if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
if: ${{ github.event.inputs.make-everything == 'true'}} | |
run: | | |
make ${{ env.MAKE_OPT }} -C src everything | |
# export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
# https://github.com/ipxe/ipxe/discussions/614#discussioncomment-2363937 | |
# @mcb30 on Mar 15, 2022 | |
# The default build will give you a BIOS image. To build an EFI image, you will need to do something like make bin-x86_64-efi/ipxe.iso. | |
# | |
# For the record: the prebuilt ISO published at https://boot.ipxe.org/ipxe.iso is a combination of the BIOS, x86_64 EFI, and Aarch64 EFI images, built using the equivalent of: | |
# make bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi | |
# make bin-arm64-efi/ipxe.efi CROSS=aarch64-linux-gnu- | |
# ./util/genfsimg -o ipxe.iso bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi bin-arm64-efi/ipxe.efi | |
# | |
# The Makefile does not currently support building this combined ISO in one step as a single target, since it involves compiling for multiple CPU architectures. | |
# - name: Build (BIOS) | |
# run: | | |
# export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
# make -j $((`nproc`+0)) -C src | |
- name: Build 1 bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi | |
run: | | |
###export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
make ${{ env.MAKE_OPT }} -C src bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi | |
#make -j $((`nproc`+1)) -C src bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi | |
- name: Build 2 bin-i386-efi/ipxe.efi | |
run: | | |
###export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
make ${{ env.MAKE_OPT }} -C src bin-i386-efi/ipxe.efi | |
#make -j $((`nproc`+1)) -C src bin-i386-efi/ipxe.efi | |
- name: Install packages arm gcc | |
run: | | |
sudo apt update | |
sudo apt install -y -o Acquire::Retries=50 \ | |
--no-install-recommends \ | |
mtools syslinux isolinux genisoimage xorriso mtools \ | |
gcc-arm-none-eabi \ | |
gcc-aarch64-linux-gnu \ | |
# g++-9-aarch64-linux-gnu | |
- name: run Build make-everything-aarch64 | |
if: ${{ github.event.inputs.make-everything-arm == 'true' }} | |
run: | | |
make ${{ env.MAKE_OPT }} -C src everything CROSS=aarch64-linux-gnu- | |
- name: run Build make-everything-arm32 | |
if: ${{ github.event.inputs.make-everything-arm == 'true' }} | |
run: | | |
make ${{ env.MAKE_OPT }} -C src everything CROSS=arm-none-eabi- | |
- name: Build 3 bin-arm64-efi/ipxe.efi CROSS=aarch64-linux-gnu- | |
run: | | |
###export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
make ${{ env.MAKE_OPT }} -C src bin-arm64-efi/ipxe.efi CROSS=aarch64-linux-gnu- | |
#make -j $((`nproc`+1)) -C src bin-arm64-efi/ipxe.efi CROSS=aarch64-linux-gnu- | |
- name: Build 4 genfsimg ipxe-bios_x86_64-efi_arm64-efi.iso | |
run: | | |
export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
#cd src && ./util/genfsimg -o ipxe-bios-arm32-arm64-arch.iso -s menu.ipxe bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi bin-arm64-efi/ipxe.efi | |
cd src && ./util/genfsimg -o ipxe-bios_x86_64-efi_arm64-efi.iso bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi bin-arm64-efi/ipxe.efi \ | |
|| ./util/genfsimg -o ipxe-bios_x86_64-efi_arm64-efi-any.iso bin/ipxe.lkrn bin-*-efi/ipxe.efi | |
#make -j $((`nproc`+0)) -C src bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi | |
#make -j $((`nproc`+0)) -C src bin-i386-efi/ipxe.efi | |
#make -j $((`nproc`+0)) -C src CROSS=arm-none-eabi- \ | |
# bin-arm32-efi/intel.efi \ | |
# bin-arm32-efi/intel.usb \ | |
# bin-arm32-efi/intel.iso \ | |
# bin-arm32-efi/snp.efi \ | |
# bin-arm32-efi/snponly.efi | |
- name: Build 5 bin-i386-efi/ipxe.efi | |
run: | | |
###export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
make ${{ env.MAKE_OPT }} -C src bin-i386-efi/ipxe.efi | |
#make -j $((`nproc`+0)) -C src bin-i386-efi/ipxe.efi | |
- name: Build 6 bin-arm32-efi/intel.efi bin-arm32-efi/snp.efi bin-arm32-efi/snponly.efi | |
run: | | |
export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
#make -j $((`nproc`+0)) -C src CROSS=arm-none-eabi- \ | |
make ${{ env.MAKE_OPT }} -C src CROSS=arm-none-eabi- \ | |
bin-arm32-efi/snp.efi | |
# bin-arm32-efi/snponly.efi \ | |
# bin-arm32-efi/intel.efi \ | |
# bin-arm32-efi/intel.usb \ | |
# bin-arm32-efi/intel.iso | |
- name: find iso fils | |
run: | | |
#set -vx | |
echo "############################" | |
find . \( \ | |
-regex ".*\.pxe\|.*\.efi\|.*\.kpxe\|.*\.kkpxe\|.*\.lkrn\|.*\.iso\|.*\.hd\|.*\.dsk\|.*\.pdsk\|.*\.usb\|.*\.vhd" \ | |
-or -regex ".*\.raw\|.*\.rom\|.*\.mrom\|.*\.pcirom\|.*\.isarom\|.*\.efidrv\|.*\.efirom\|.*\.linux" \ | |
\) \( ! -name "Makefile*" \) -print | |
find . \( \ | |
-regex ".*\.pxe\|.*\.efi\|.*\.kpxe\|.*\.kkpxe\|.*\.lkrn\|.*\.iso\|.*\.hd\|.*\.dsk\|.*\.pdsk\|.*\.usb\|.*\.vhd" \ | |
-or -regex ".*\.raw\|.*\.rom\|.*\.mrom\|.*\.pcirom\|.*\.isarom\|.*\.efidrv\|.*\.efirom\|.*\.linux" \ | |
\) \( ! -name "Makefile*" \) -exec ls -lah '{}' ';' | |
echo "############################" | |
find . \( -name "*.lkrn" \ | |
-or -name "*.lkr" \ | |
-or -name "*.efi" \ | |
-or -name "*.iso" \ | |
\) \( ! -name "Makefile*" \) -print | |
find . \( -name "*.lkrn" \ | |
-or -name "*.lkr" \ | |
-or -name "*.efi" \ | |
-or -name "*.iso" \ | |
\) \( ! -name "Makefile*" \) -exec ls -lah '{}' ';' | |
echo "############################" | |
- name: Build 7 genfsimg ipxe-bios__x86_64-efi__i386-efi__arm64-efi__arm32-efi.iso | |
run: | | |
set -vx | |
export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
#cd src && ./util/genfsimg -o ipxe-bios-i386-arm32-arm64-arch.iso -s menu.ipxe bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi bin-arm64-efi/ipxe.efi | |
cd src && ./util/genfsimg -o ipxe-bios__x86_64-efi__i386-efi__arm64-efi__arm32-efi.iso \ | |
bin/ipxe.lkrn \ | |
bin-x86_64-efi/ipxe.efi \ | |
bin-arm64-efi/ipxe.efi \ | |
bin-i386-efi/ipxe.efi \ | |
bin-arm32-efi/snp.efi \ | |
|| ./util/genfsimg -o ipxe-bios__x86_64-efi__arm64-efi__i386-efi__arm32-efi__any.iso bin/ipxe.lkrn bin-*-efi/ipxe.efi | |
# bin-arm32-efi/intel.efi \ | |
# bin-arm32-efi/snp.efi \ | |
# bin-arm32-efi/snponly.efi \ | |
#- name: Build ARM64 | |
# run: | | |
# export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
# make -j $((`nproc`+0)) -C src CROSS=aarch64-linux-gnu- \ | |
# bin-arm64-efi/ipxe.efi \ | |
# bin-arm64-efi/ipxe.usb \ | |
# bin-arm64-efi/ipxe.iso | |
- name: Install for ISO build | |
run: | | |
sudo apt install -y -o Acquire::Retries=50 \ | |
--no-install-recommends \ | |
mtools syslinux isolinux \ | |
p7zip-full genisoimage mtools isolinux syslinux syslinux-efi syslinux-utils xorriso | |
- name: Build ISO | |
run: | | |
export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
#find . \( -name "*.lkrn" -or -name "*.efi" -or -name "*.iso" \) \( ! -name "Makefile*" \) -print | |
cd src && ./util/genfsimg -o ipxe-all-arch.iso -s menu.ipxe \ | |
bin-i386-efi/ipxe.efi \ | |
bin-x86_64-efi/ipxe.efi \ | |
bin-arm32-efi/ipxe.efi \ | |
bin-arm64-efi/ipxe.efi \ | |
bin/ipxe.lkrn || \ | |
./util/genfsimg -o ipxe-any2.iso bin-*-efi/ipxe.efi bin/ipxe.lkrn | |
- name: list ISO | |
run: | | |
find . \( -name "*.lkrn" -or -name "*.lkr" -or -name "*.efi" -or -name "*.iso" \) \( ! -name "Makefile*" \) -print | |
find . \( -name "*.lkrn" -or -name "*.lkr" -or -name "*.efi" -or -name "*.iso" \) \( ! -name "Makefile*" \) -exec ls -lah '{}' ';' | |
find . \( -name "*.iso" \) \( ! -name "Makefile*" \) -print -exec isoinfo -d -i '{}' ';' | |
find . \( -name "*.iso" \) \( ! -name "Makefile*" \) -print -exec isoinfo -l -i '{}' ';' | |
#find . \( -name "*.lkrn" -or -name "*.lkr" -or -name "*.efi" -or -name "*.iso" \) \( ! -name "Makefile*" \) -exec 7z l '{}' ';' | |
find . \( -name "*.iso" \) \( ! -name "Makefile*" \) -exec 7z l '{}' ';' | |
# - name: Build (Everything) | |
# run: | | |
# make ${{ env.MAKE_OPT }} -C src everything | |
# export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
# NOT working# - name: Build valgrind Tests | |
# NOT working# run: | | |
# NOT working# export PATH="/usr/local/lib/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
# NOT working# make -j $((`nproc`+1)) -C src bin-i386-linux/tests.linux bin-x86_64-linux/tests.linux | |
# - name: valgrind Tests | |
# run: | | |
# valgrind ./src/bin-i386-linux/tests.linux | |
# valgrind ./src/bin-x86_64-linux/tests.linux | |
- uses: actions/cache/[email protected] | |
###id: cache-apt-save | |
if: ${{ github.event.inputs.no-cache-save-apt != 'true' }} | |
###if: always() # or any other condition to invoke the save action | |
with: | |
path: /var/cache/apt/archives/*.deb | |
key: cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('/var/cache/apt/archives/*.deb') }} | |
#key: ${{ steps.cache-apt-restore.outputs.cache-primary-key }} | |
#key: cache-save-apt-${{ runner.os }}-${{ env.LSB_RELEASE_SC }}-${{ matrix.ghc }}-${{ matrix.os }}-${{ matrix.type }}-${{ hashFiles('/var/cache/apt/archives/*.deb') }} |