From f6ec28e32b9632c9392f80ddf64ab1b855e1db38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Sat, 14 May 2022 12:10:41 +0200 Subject: [PATCH] GCC 11.2 needed for kernel>=5.17. Updated Ubuntu Kernel packages are downloaded first to allow fail fast. Removed workaround for libc6 (allready on 22.04 LTS). Add additional code to skip executions for kernels >= 5.17 and GCC < 11.2. --- .github/workflows/build.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb16ce0..819e9d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,9 @@ jobs: JSON=$(curl -s https://www.kernel.org/releases.json) VERSIONSARRAY=$(echo $JSON | jq -c '[.releases[] | {version: .version, moniker: .moniker} | select(.moniker != "linux-next") | .version]') echo ::set-output name=matrix::${VERSIONSARRAY} - build: needs: commontasks - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -33,11 +32,19 @@ jobs: gcc_version: [9, 10, 11] #kernel_version: [5.15-rc3,5.14.10] steps: - - name: Set up GCC - uses: egor-tensin/setup-gcc@v1 - with: - version: ${{matrix.gcc_version }} - - name: install deb packages + - name: Check Versions + id: check_version + shell: bash {0} + run: | + echo ::set-output name=skip_build::False + dpkg --compare-versions "${{matrix.kernel_version}}" "ge" "5.17" + if [ $? -eq "0" ] && [ ${{matrix.gcc_version}} -lt 11 ]; + then + echo "GCC version not compatible" + echo ::set-output name=skip_build::True + fi + - name: Download kernel packages + if: steps.check_version.outputs.skip_build == 'False' run: | KERNEL_URL=https://kernel.ubuntu.com/~kernel-ppa/mainline/ KERNEL_URL_DETAILS=$(wget --quiet -O - ${KERNEL_URL}v${{matrix.kernel_version}}/ | grep -A8 "Build for amd64\|Test amd64") @@ -47,9 +54,17 @@ jobs: [ -z "$AMD64_DEB" ] && exit 2 wget -nv ${KERNEL_URL}v${{matrix.kernel_version}}/$AMD64_DEB wget -nv ${KERNEL_URL}v${{matrix.kernel_version}}/$ALL_DEB - wget -nv http://mirrors.edge.kernel.org/ubuntu/pool/main/g/glibc/libc6_2.34-0ubuntu3_amd64.deb - sudo dpkg --force-all -i *.deb echo "KVER=$(echo $ALL_DEB | cut -d '_' -f 2 | rev | cut -c14- | rev)-generic" >> $GITHUB_ENV + - name: Set up GCC + if: steps.check_version.outputs.skip_build == 'False' + uses: egor-tensin/setup-gcc@v1 + with: + version: ${{matrix.gcc_version }} + - name: install deb packages + if: steps.check_version.outputs.skip_build == 'False' + run: sudo dpkg --force-all -i *.deb - uses: actions/checkout@v2 + if: steps.check_version.outputs.skip_build == 'False' - name: build kernel ${{ matrix.kernel_version }} - GCC ${{ matrix.gcc_version }} + if: steps.check_version.outputs.skip_build == 'False' run: make KVER=$KVER CC=cc