Fix GLIBC_2.38 requirement for CI (#335)

This commit is contained in:
Carlos Garcés 2024-01-20 12:57:34 +01:00 committed by GitHub
parent f2fc8af7ab
commit bca1d7eb80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,68 +3,68 @@ name: Build
on: [pull_request] on: [pull_request]
jobs: jobs:
commontasks: commontasks:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }} matrix: ${{ steps.set-matrix.outputs.matrix }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Avoid 0x0BDA - name: Avoid 0x0BDA
#Find devices that not use 0x0BDA instead of const USB_VENDOR_ID_REALTEK #Find devices that not use 0x0BDA instead of const USB_VENDOR_ID_REALTEK
run: grep -c -i "0x0BDA" os_dep/linux/usb_intf.c | grep -w 1 run: grep -c -i "0x0BDA" os_dep/linux/usb_intf.c | grep -w 1
- name: Find duplicates - name: Find duplicates
#Find devices that not use 0x0BDA instead of const USB_VENDOR_ID_REALTEK #Find devices that not use 0x0BDA instead of const USB_VENDOR_ID_REALTEK
run: grep -i "{USB_DEVICE(" os_dep/linux/usb_intf.c | cut -d ')' -f1 | sort | uniq -cd | wc -c | grep -w 0 run: grep -i "{USB_DEVICE(" os_dep/linux/usb_intf.c | cut -d ')' -f1 | sort | uniq -cd | wc -c | grep -w 0
- name: Get kernel matrix - name: Get kernel matrix
id: set-matrix id: set-matrix
run: | run: |
JSON=$(curl -s https://www.kernel.org/releases.json) JSON=$(curl -s https://www.kernel.org/releases.json)
VERSIONSARRAY=$(echo $JSON | jq -c '[.releases[] | {version: .version, moniker: .moniker} | select(.moniker != "linux-next") | .version]') VERSIONSARRAY=$(echo $JSON | jq -c '[.releases[] | {version: .version, moniker: .moniker} | select(.moniker != "linux-next") | .version]')
echo ::set-output name=matrix::${VERSIONSARRAY} echo ::set-output name=matrix::${VERSIONSARRAY}
build: build:
needs: commontasks needs: commontasks
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
kernel_version: ${{fromJson(needs.commontasks.outputs.matrix)}} kernel_version: ${{fromJson(needs.commontasks.outputs.matrix)}}
gcc_version: [9, 10, 12] gcc_version: [9, 10, 12]
# kernel_version: [6.1-rc1] # kernel_version: [6.1-rc1]
steps: steps:
- name: Check Versions - name: Check Versions
id: check_version id: check_version
shell: bash {0} shell: bash {0}
run: | run: |
echo ::set-output name=skip_build::False echo ::set-output name=skip_build::False
dpkg --compare-versions "${{matrix.kernel_version}}" "ge" "5.15" dpkg --compare-versions "${{matrix.kernel_version}}" "ge" "5.15"
if [ $? -eq "0" ] && [ ${{matrix.gcc_version}} -lt 12 ]; if [ $? -eq "0" ] && [ ${{matrix.gcc_version}} -lt 12 ];
then then
echo "GCC version not compatible" echo "GCC version not compatible"
echo ::set-output name=skip_build::True echo ::set-output name=skip_build::True
fi fi
- name: Download kernel packages - name: Download kernel packages
if: steps.check_version.outputs.skip_build == 'False' if: steps.check_version.outputs.skip_build == 'False'
run: | run: |
KERNEL_URL=https://kernel.ubuntu.com/~kernel-ppa/mainline/ 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") KERNEL_URL_DETAILS=$(wget --quiet -O - ${KERNEL_URL}v${{matrix.kernel_version}}/ | grep -A8 "Build for amd64\|Test amd64")
ALL_DEB=$(echo "$KERNEL_URL_DETAILS" | grep -m1 'all.deb' | cut -d '"' -f 2) ALL_DEB=$(echo "$KERNEL_URL_DETAILS" | grep -m1 'all.deb' | cut -d '"' -f 2)
AMD64_DEB=$(echo "$KERNEL_URL_DETAILS" | grep -m1 "amd64.deb" | cut -d '"' -f 2) AMD64_DEB=$(echo "$KERNEL_URL_DETAILS" | grep -m1 "amd64.deb" | cut -d '"' -f 2)
[ -z "$ALL_DEB" ] && exit 1 [ -z "$ALL_DEB" ] && exit 1
[ -z "$AMD64_DEB" ] && exit 2 [ -z "$AMD64_DEB" ] && exit 2
wget -nv ${KERNEL_URL}v${{matrix.kernel_version}}/$AMD64_DEB wget -nv ${KERNEL_URL}v${{matrix.kernel_version}}/$AMD64_DEB
wget -nv ${KERNEL_URL}v${{matrix.kernel_version}}/$ALL_DEB wget -nv ${KERNEL_URL}v${{matrix.kernel_version}}/$ALL_DEB
echo "KVER=$(echo $ALL_DEB | cut -d '_' -f 2 | rev | cut -c14- | rev)-generic" >> $GITHUB_ENV wget -nv http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/libc6_2.38-1ubuntu6_amd64.deb
- name: Set up GCC echo "KVER=$(echo $ALL_DEB | cut -d '_' -f 2 | rev | cut -c14- | rev)-generic" >> $GITHUB_ENV
if: steps.check_version.outputs.skip_build == 'False' - name: Set up GCC
uses: egor-tensin/setup-gcc@v1 if: steps.check_version.outputs.skip_build == 'False'
with: uses: egor-tensin/setup-gcc@v1
version: ${{matrix.gcc_version }} with:
- name: install deb packages version: ${{matrix.gcc_version }}
if: steps.check_version.outputs.skip_build == 'False' - name: install deb packages
run: sudo dpkg --force-all -i *.deb if: steps.check_version.outputs.skip_build == 'False'
- uses: actions/checkout@v2 run: sudo dpkg --force-all -i *.deb
if: steps.check_version.outputs.skip_build == 'False' - uses: actions/checkout@v2
- name: build kernel ${{ matrix.kernel_version }} - GCC ${{ matrix.gcc_version }} if: steps.check_version.outputs.skip_build == 'False'
if: steps.check_version.outputs.skip_build == 'False' - name: build kernel ${{ matrix.kernel_version }} - GCC ${{ matrix.gcc_version }}
run: make KVER=$KVER CC=cc if: steps.check_version.outputs.skip_build == 'False'
run: make KVER=$KVER CC=cc