From 191bea1c52894c706fb5a42a30eb8acf3483a8df Mon Sep 17 00:00:00 2001 From: Johnny Mnemonic Date: Sun, 11 Feb 2024 20:22:16 +0100 Subject: [PATCH] Also enable build for HP Sim platform and Ski build and test for: * 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 --- .github/workflows/mirror.yml | 132 ++++++------------ .../{run_ski_test.bash => run-ski-test.bash} | 2 - 2 files changed, 42 insertions(+), 92 deletions(-) rename tools/{run_ski_test.bash => run-ski-test.bash} (97%) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index ec486121b1333..1aafae731b870 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -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: | @@ -125,6 +75,14 @@ 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 + + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.branch }}-old-kernel-version + github-token: ${{ secrets.PAT }} + if-no-files-found: warn + retention-days: 5 - name: regular_build_step run: | @@ -132,7 +90,12 @@ jobs: # apply any standard patches ######################################### PATH=${MODPATH} cd ${BUILD_DIR} + OLD_KERNEL_VERSION=$( cat ${GITHUB_WORKSPACE}/${BRANCH}-old-kernel-version ) 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 @@ -146,25 +109,25 @@ 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 + - 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} @@ -184,6 +147,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" @@ -192,19 +156,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} @@ -220,6 +177,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" @@ -231,6 +189,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" @@ -240,22 +199,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 @@ -264,11 +216,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 diff --git a/tools/run_ski_test.bash b/tools/run-ski-test.bash similarity index 97% rename from tools/run_ski_test.bash rename to tools/run-ski-test.bash index 95d111f0e869c..b1696d0eb75b8 100755 --- a/tools/run_ski_test.bash +++ b/tools/run-ski-test.bash @@ -37,8 +37,6 @@ sleep 5 kill ${_tailPID} kill ${_skiPID} -cat ${_skiLog} - if grep 'INFO: Ski test succeeded.' ${_skiLog} &>/dev/null; then rm ${_skiLog}