Support in-tree builds

This change updates the build code to support in-tree builds. This is
easier to manage for CI builds and reduces the amount of IO operations
necessary for the build process.
This commit is contained in:
Fabian Mastenbroek 2021-04-18 19:55:44 +02:00
parent 7d07970695
commit 3650d4343a
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
7 changed files with 121 additions and 198 deletions

View file

@ -6,30 +6,25 @@ jobs:
build:
name: Build
runs-on: [self-hosted]
strategy:
matrix:
include:
- build_cc: gcc-10
if: github.event.pull_request.head.repo.full_name == github.repository && !contains(github.event.head_commit.message, 'skip ci')
steps:
- name: Clean Workspace
run: rm -rf *.deb *.ddeb *.build *.buildinfo *.changes
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: recursive
path: pve-edge-kernel
- name: Clean Repository
run: git -C pve-edge-kernel submodule foreach git clean -ffdx
- name: Build Kernel
run: make
env:
PVE_BUILD_CC: ${{ matrix.build_cc }}
- name: Read Build Information
id: read_build_info
run: |
echo "::set-output name=release::$(sed '1q;d' release.txt)"
echo "::set-output name=dst::$(sed '1q;d' artifacts.txt)"
echo "::set-output name=hdr::$(sed '2q;d' artifacts.txt)"
echo "::set-output name=tools::$(sed '3q;d' artifacts.txt)"
rm -rf *.deb *.ddeb *.build *.buildinfo *.changes
cd pve-edge-kernel
debian/rules debian/control
debuild -e CC=gcc-10 -e CCACHE_DIR=/var/cache/ccache --prepend-path=/usr/lib/ccache --jobs=auto -b -uc -us
- name: Upload Artifacts
uses: actions/upload-artifact@v2-preview
with:
name: debs-${{ matrix.build_type }}
path: "*.deb"
name: debs
path: "*.deb"

View file

@ -13,33 +13,38 @@ jobs:
strategy:
matrix:
include:
- build_type: 'generic'
- build_profile: 'generic'
build_cc: gcc-10
build_cflags: ''
- build_type: zen2
- build_profile: zen2
build_cc: gcc-10
build_cflags: '-march=znver2'
- build_type: cascadelake
- build_profile: cascadelake
build_cc: gcc-10
build_cflags: '-march=cascadelake'
steps:
- name: Clean Workspace
run: rm -rf *.deb *.ddeb *.build *.buildinfo *.changes
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: recursive
path: pve-edge-kernel
- name: Clean Repository
run: git -C pve-edge-kernel submodule foreach git clean -ffdx
- name: Build Kernel
run: make
env:
PVE_BUILD_TYPE: ${{ matrix.build_type }}
PVE_BUILD_CC: ${{ matrix.build_cc }}
PVE_BUILD_CFLAGS: ${{ matrix.build_cflags }}
- name: Read Build Information
id: read_build_info
run: |
echo "::set-output name=release::$(sed '1q;d' release.txt)"
echo "::set-output name=dst::$(sed '1q;d' artifacts.txt)"
echo "::set-output name=hdr::$(sed '2q;d' artifacts.txt)"
echo "::set-output name=tools::$(sed '3q;d' artifacts.txt)"
cd pve-edge-kernel
debian/rules debian/control
if [ "$PVE_BUILD_PROFILE" != "generic" ]; then
debchange -l +$PVE_BUILD_PROFILE -D edge --force-distribution -U -M "Specialization for $PVE_BUILD_PROFILE"
fi
debuild -e PVE* -e CCACHE_DIR=/var/cache/ccache --prepend-path=/usr/lib/ccache --jobs=auto -b -uc -us
env:
PVE_BUILD_PROFILE: ${{ matrix.build_type }}
PVE_KERNEL_CC: ${{ matrix.build_cc }}
PVE_KERNEL_CFLAGS: ${{ matrix.build_cflags }}
PVE_ZFS_CC: ${{ matrix.build_cc }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2-preview
with:
@ -80,5 +85,4 @@ jobs:
artifacts/debs-generic/pve-headers-*.deb
artifacts/debs-generic/linux-tools-*.deb
artifacts/debs-generic/pve-kernel-libc-*.deb
artifacts/debs-*/pve-kernel-*.deb
artifacts/debs-*/pve-kernel-*.deb