Skip to content

Commit

Permalink
Also enable build for HP Sim platform and Ski build and test for:
Browse files Browse the repository at this point in the history
* linux-6.1.y
* linux-6.6.y
* linux-6.7.y

...and deactivate mirror_and_check for testing

Other changes:

* artifact upload and download saving the last successfully built kernel
version to avoid unneccessary builds.
* introduce an early exit if a required step fails
  • Loading branch information
johnny-mnemonic committed Feb 11, 2024
1 parent 9e5c30d commit 82c7165
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 92 deletions.
133 changes: 43 additions & 90 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,14 @@ on:
workflow_dispatch:

jobs:
mirror_and_check:
runs-on: ubuntu-latest
outputs:
branch_matrix: ${{ steps.check.outputs.branch_matrix }}
steps:
- name: mirror
id: mirror
uses: bridgelightcloud/github-mirror-action@v3
with:
origin: 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git'
GITHUB_TOKEN: ${{ secrets.PAT }}

- name: check
id: check
run: |
REPO=$( basename $PWD )
cd ..
mv $REPO ${REPO}.git
git clone --shared ${REPO}.git $REPO
JSON_DATA_FILE="$PWD/workflows.json"
touch ${JSON_DATA_FILE}
cd $REPO
# go through all configured branches and check for RCs ###############
for branch in $( cat config/rc-branches ); do
git worktree add ../${branch} ${branch}
pushd ../${branch}
pwd
if git log --oneline | head -n1 | grep "Linux\ .*" &>/dev/null; then
KERNEL_VERSION=$( git log --oneline | head -n1 | grep -o "Linux\ .*" )
echo "DEBUG build ${KERNEL_VERSION}"
if [[ -s ${JSON_DATA_FILE} ]]; then
echo "DEBUG , \"${branch}\""
echo -n ", \"${branch}\"" >> ${JSON_DATA_FILE}
else
echo "DEBUG [\"${branch}\""
echo -n "[\"${branch}\"" >> ${JSON_DATA_FILE}
fi
fi
popd
pwd
done
if [[ ! -s ${JSON_DATA_FILE} ]]; then
# insert dummy element #############################################
echo -n "[\"NO_BUILD\"" >> ${JSON_DATA_FILE}
fi
echo -n "]" >> ${JSON_DATA_FILE}
pwd
cat -v ${JSON_DATA_FILE} || echo "DEBUG #2"
echo "branch_matrix=$( jq -cn --argjson environments "$( cat ${JSON_DATA_FILE} )" '{branch: $environments}' )" >> $GITHUB_OUTPUT
matrix_build:
needs: mirror_and_check
# needs: mirror_and_check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.mirror_and_check.outputs.branch_matrix)}}
# matrix:
# branch: [linux-4.19.y, linux-5.4.y, linux-5.10.y, linux-5.15.y, linux-6.1.y, linux-6.6.y, linux-6.7.y]
# matrix: ${{fromJson(needs.mirror_and_check.outputs.branch_matrix)}}
matrix:
branch: [linux-4.19.y, linux-5.4.y, linux-5.10.y, linux-5.15.y, linux-6.1.y, linux-6.6.y, linux-6.7.y]
steps:
- name: no_build_step
run: |
Expand Down Expand Up @@ -125,14 +75,27 @@ jobs:
echo "MODPATH=${PATH}" >> $GITHUB_ENV
echo "CROSS_COMPILER_AND_VERSION=${CROSS_COMPILER_AND_VERSION}" >> $GITHUB_ENV
echo "SUMMARY_FILE=${SUMMARY_FILE}" >> $GITHUB_ENV
echo "EXIT_EARLY=0" >> $GITHUB_ENV
- name: download_artifact
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ matrix.branch }}-old-kernel-version
github-token: ${{ secrets.PAT }}

- name: regular_build_step
run: |
USED_PATCHES="see [__mirror/patches/${BRANCH}/](https://github.com/johnny-mnemonic/linux-stable-rc/tree/__mirror/patches/${BRANCH}/)"
# apply any standard patches #########################################
PATH=${MODPATH}
cd ${BUILD_DIR}
OLD_KERNEL_VERSION=$( cat ${GITHUB_WORKSPACE}/${BRANCH}-old-kernel-version || true )
KERNEL_VERSION=$( git log --oneline | head -n1 | grep -o "Linux\ .*" )
if [[ ${OLD_KERNEL_VERSION} == "${KERNEL_VERSION}" ]]; then
echo "EXIT_EARLY=1" >> $GITHUB_ENV
exit 0
fi
if [[ -e ${TOOLS_DIR}/patches/${BRANCH}/ ]]; then
for patch in ${TOOLS_DIR}/patches/${BRANCH}/*patch; do
patch -p1 < ${patch} || true
Expand All @@ -146,25 +109,26 @@ jobs:
echo "| ------ | ------ | ------- | ---- | ------------ | -------- |" >> ${SUMMARY_FILE}
if time ./tools/make-kernel.bash ./config/rx2620-rx2660-rx2800-i2-combined-localmodconfig ia64 ${BUILD_DIR}; then
echo "| :white_check_mark: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "${KERNEL_VERSION}" > ${GITHUB_WORKSPACE}/${BRANCH}-old-kernel-version
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | regular | ${USED_PATCHES} |${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
true
fi
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.branch }}-old-kernel-version
path: ${GITHUB_WORKSPACE}/${{ matrix.branch }}-old-kernel-version
overwrite: true
retention-days: 5

- name: hp_sim_build_step
run: |
if [[ ${EXIT_EARLY} -eq 1 ]]; then
exit 0
fi
USED_PATCHES="see [hp-sim-for-linux/${BRANCH}/](https://github.com/johnny-mnemonic/ski/tree/hp-sim-for-linux/${BRANCH}/)"
# ski available for our branch? ######################################
case ${BRANCH} in
linux-6.1.y | linux-6.6.y | linux-6.7.y)
echo "Ski not yet reinstated for ${BRANCH}"
exit 0
;;
*)
true
;;
esac
# apply ski patches ##################################################
PATH=${MODPATH}
cd ${BUILD_DIR}
Expand All @@ -184,6 +148,7 @@ jobs:
true
else
echo "| :x: | ${BRANCH} | ${KERNEL_VERSION} | hp_sim | ${USED_PATCHES} | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "EXIT_EARLY=1" >> $GITHUB_ENV
true
fi
HP_SIM_KERNEL="${BUILD_DIR}/../vmlinux-ski"
Expand All @@ -192,19 +157,12 @@ jobs:
- name: ski_build_step
run: |
# ski available for our branch? ######################################
case ${BRANCH} in
linux-6.1.y | linux-6.6.y | linux-6.7.y)
echo "Ski not yet reinstated for ${BRANCH}"
exit 0
;;
*)
true
;;
esac
if [[ ${EXIT_EARLY} -eq 1 ]]; then
exit 0
fi
# install build dependencies #########################################
sudo apt update
sudo apt install binutils-dev libelf-dev libiberty-dev libncurses-dev autoconf autoconf-archive automake flex bison gperf pkg-config
sudo apt -y install binutils-dev libelf-dev libiberty-dev libncurses-dev autoconf autoconf-archive automake flex bison gperf pkg-config
# build Ski ##########################################################
COMPILER_AND_VERSION=$( gcc --version | head -n1 )
cd ${SKI_DIR}
Expand All @@ -220,6 +178,7 @@ jobs:
true
else
echo "| :x: | ski | ${COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "EXIT_EARLY=1" >> $GITHUB_ENV
true
fi
SKI_PATH="${SKI_DIR}/install/bin"
Expand All @@ -231,6 +190,7 @@ jobs:
true
else
echo "| :x: | ski-bootloader | ${CROSS_COMPILER_AND_VERSION} |" >> ${SUMMARY_FILE}
echo "EXIT_EARLY=1" >> $GITHUB_ENV
true
fi
SKI_BOOTLOADER="${SKI_DIR}/ski-bootloader/ski-bootloader"
Expand All @@ -240,22 +200,15 @@ jobs:
- name: ski_test_step
run: |
# ski available for our branch? ######################################
case ${BRANCH} in
linux-6.1.y | linux-6.6.y | linux-6.7.y)
echo "Ski not yet reinstated for ${BRANCH}"
exit 0
;;
*)
true
;;
esac
if [[ ${EXIT_EARLY} -eq 1 ]]; then
exit 0
fi
# get ia64 root FS ###################################################
PATH=$PATH:${SKI_PATH}
SKI_TEST_DIR="${BASE_DIR}/ski-test"
mkdir ${SKI_TEST_DIR} && cd ${SKI_TEST_DIR}
cp ${TOOLS_DIR}/tools/run_ski_test.bash ${TOOLS_DIR}/config/sdc-debian.xz.SHA256 .
chmod +x run_ski_test.bash
cp ${TOOLS_DIR}/tools/run-ski-test.bash ${TOOLS_DIR}/config/sdc-debian.xz.SHA256 .
chmod +x run-ski-test.bash
IA64_ROOTFS_URL=$( cat ${TOOLS_DIR}/config/ia64-rootfs-url )
wget "${IA64_ROOTFS_URL}"
if sha256sum -c sdc-debian.xz.SHA256; then
Expand All @@ -264,11 +217,11 @@ jobs:
echo "" >> ${SUMMARY_FILE}
echo "| STATUS | TOOL |" >> ${SUMMARY_FILE}
echo "| ------ | ---- |" >> ${SUMMARY_FILE}
if ./run_ski_test.bash ${SKI_BOOTLOADER} ${HP_SIM_KERNEL}; then
echo "| :white_check_mark: | run_ski_test.bash |" >> ${SUMMARY_FILE}
if ./run-ski-test.bash ${SKI_BOOTLOADER} ${HP_SIM_KERNEL}; then
echo "| :white_check_mark: | run-ski-test.bash |" >> ${SUMMARY_FILE}
true
else
echo "| :x: | run_ski_test.bash |" >> ${SUMMARY_FILE}
echo "| :x: | run-ski-test.bash |" >> ${SUMMARY_FILE}
true
fi
else
Expand Down
2 changes: 0 additions & 2 deletions tools/run_ski_test.bash → tools/run-ski-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ sleep 5
kill ${_tailPID}
kill ${_skiPID}

cat ${_skiLog}

if grep 'INFO: Ski test succeeded.' ${_skiLog} &>/dev/null; then

rm ${_skiLog}
Expand Down

0 comments on commit 82c7165

Please sign in to comment.