-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor out incremental build prep into an action
- Loading branch information
Showing
5 changed files
with
88 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: 'Prepare incremental kernel build' | ||
description: 'Pull cached kernel build output from previous runs and prepare the repo for incremental build' | ||
inputs: | ||
repo-root: | ||
description: "Root of the kernel repository" | ||
required: true | ||
default: ${{ github.workspace }} | ||
base-branch: | ||
description: "Base branch for cache lookup" | ||
required: true | ||
default: bpf-next_base | ||
arch: | ||
required: true | ||
type: string | ||
description: "Part of cache lookup key" | ||
toolchain_full: | ||
required: true | ||
type: string | ||
description: "Part of cache lookup key" | ||
kbuild-output: | ||
required: true | ||
type: string | ||
description: "Path to KBUILD_OUTPUT" | ||
default: kbuild-output | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Get commit meta-data for cache lookup | ||
id: get-commit-metadata | ||
shell: bash | ||
working-directory: ${{ inputs.repo-root }} | ||
run: ${GITHUB_ACTION_PATH}/get-commit-metadata.sh ${{ inputs.base-branch }} | ||
|
||
- name: Pull recent KBUILD_OUTPUT contents | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ inputs.kbuild-output }} | ||
key: kbuild-output-${{ inputs.arch }}-${{ inputs.toolchain_full }}-${{ steps.get-commit-metadata.outputs.branch }}-${{ steps.get-commit-metadata.outputs.timestamp }}-${{ steps.get-commit-metadata.outputs.commit }} | ||
restore-keys: | | ||
kbuild-output-${{ inputs.arch }}-${{ inputs.toolchain_full }}-${{ steps.get-commit-metadata.outputs.branch }}-${{ steps.get-commit-metadata.outputs.timestamp }}- | ||
kbuild-output-${{ inputs.arch }}-${{ inputs.toolchain_full }}-${{ steps.get-commit-metadata.outputs.branch }}- | ||
kbuild-output-${{ inputs.arch }}-${{ inputs.toolchain_full }}- | ||
- name: Prepare incremental build | ||
shell: bash | ||
env: | ||
KBUILD_OUTPUT: ${{ inputs.kbuild-output }} | ||
working-directory: ${{ inputs.repo-root }} | ||
run: ${GITHUB_ACTION_PATH}/prepare-incremental-builds.sh ${{ steps.get-commit-metadata.outputs.commit }} | ||
|
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# branch="${GITHUB_BASE_REF}" | ||
|
||
# if [ "${GITHUB_EVENT_NAME}" = 'push' ]; then | ||
# branch="${GITHUB_REF_NAME}" | ||
# fi | ||
|
||
set -eux | ||
|
||
branch=${1:-bpf-next_base} | ||
|
||
echo "branch=${branch}" >> "${GITHUB_OUTPUT}" | ||
|
||
upstream="${branch//_base/}" | ||
|
||
git fetch --quiet --prune --no-tags --depth=1 --no-recurse-submodules \ | ||
origin "+refs/heads/${upstream}:refs/remotes/origin/${upstream}" | ||
commit=$(git rev-parse "origin/${upstream}") | ||
|
||
timestamp_utc="$(TZ=utc git show --format='%cd' --no-patch --date=iso-strict-local "${commit}")" | ||
|
||
echo "timestamp=${timestamp_utc}" >> "${GITHUB_OUTPUT}" | ||
echo "commit=${commit}" >> "${GITHUB_OUTPUT}" | ||
echo "Most recent upstream commit is ${commit}" | ||
|
File renamed without changes.