From 10e3ce8a99a9f498cf69c4cbf0ae6eca24ff265d Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 07:48:09 +0200 Subject: [PATCH 01/26] ci: Remove eatmydata It fails sometimes and the build time doesn't increase Error is: ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. --- .github/workflows/ci.yml | 124 +++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 001e9147e4e..927cab49e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,16 +30,15 @@ jobs: - name: Build RIP & test run: | set -x - sudo apt-get --yes -o Acquire::Retries=5 install eatmydata - eatmydata ./scripts/travis-install-build-deps.sh + ./scripts/travis-install-build-deps.sh sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - eatmydata ./configure --disable-check-runtime-deps --enable-werror - eatmydata make -O -j$((1+$(nproc))) default pycheck V=1 + ./autogen.sh + ./configure --disable-check-runtime-deps --enable-werror + make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs - eatmydata ../scripts/rip-environment runtests -p + ../scripts/rip-environment runtests -p rip-rtai: runs-on: ubuntu-24.04 @@ -56,7 +55,6 @@ jobs: - name: Build RIP RTAI run: | set -x - sudo apt-get --yes -o Acquire::Retries=5 install eatmydata #To install the RTAI deb's from linuxcnc base #echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ trixie base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null #GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) @@ -71,14 +69,14 @@ jobs: curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb #----- - eatmydata ./scripts/travis-install-build-deps.sh + ./scripts/travis-install-build-deps.sh sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - #eatmydata ./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps --enable-werror - eatmydata ./configure --with-realtime=/usr/realtime-5.4.302-rtai-amd64 --disable-check-runtime-deps --enable-werror - eatmydata make -O -j$((1+$(nproc))) default pycheck V=1 + ./autogen.sh + #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps --enable-werror + ./configure --with-realtime=/usr/realtime-5.4.302-rtai-amd64 --disable-check-runtime-deps --enable-werror + make -O -j$((1+$(nproc))) default pycheck V=1 rip-and-test-clang: runs-on: ubuntu-24.04 @@ -95,17 +93,16 @@ jobs: - name: Clang build RIP & test run: | set -x - sudo apt-get --yes -o Acquire::Retries=5 install eatmydata - eatmydata ./scripts/travis-install-build-deps.sh - sudo eatmydata apt-get -y -o Acquire::Retries=5 install clang + ./scripts/travis-install-build-deps.sh + sudo apt-get -y -o Acquire::Retries=5 install clang sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - CC=clang CXX=clang++ eatmydata ./configure --disable-check-runtime-deps --enable-werror - eatmydata make -O -j$((1+$(nproc))) default pycheck V=1 + ./autogen.sh + CC=clang CXX=clang++ ./configure --disable-check-runtime-deps --enable-werror + make -O -j$((1+$(nproc))) default pycheck V=1 # Note that the package build covers html docs - eatmydata ../scripts/rip-environment runtests -p + ../scripts/rip-environment runtests -p htmldocs: runs-on: ubuntu-24.04 @@ -122,15 +119,14 @@ jobs: - name: Build HTML docmentation run: | ./scripts/travis-install-build-deps.sh - sudo apt-get -y -o Acquire::Retries=5 install eatmydata sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + sudo apt --yes --quiet -o Acquire::Retries=5 upgrade cd src - eatmydata ./autogen.sh - eatmydata ./configure --disable-check-runtime-deps --enable-build-documentation=html - eatmydata make -O -j$((1+$(nproc))) manpages - eatmydata make -O -j$((1+$(nproc))) translateddocs - eatmydata make -O -j$((1+$(nproc))) docs + ./autogen.sh + ./configure --disable-check-runtime-deps --enable-build-documentation=html + make -O -j$((1+$(nproc))) manpages + make -O -j$((1+$(nproc))) translateddocs + make -O -j$((1+$(nproc))) docs # Note that the package build covers html docs package-arch: @@ -156,10 +152,10 @@ jobs: set -e set -x apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl - eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + apt-get --yes --quiet -o Acquire::Retries=5 install curl + apt --yes --quiet -o Acquire::Retries=5 upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - uses: actions/checkout@v3 with: @@ -180,11 +176,11 @@ jobs: esac set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common - eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF + apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common + gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base" - eatmydata apt-get --quiet -o Acquire::Retries=5 update + add-apt-repository "deb http://linuxcnc.org $DIST base" + apt-get --quiet -o Acquire::Retries=5 update - name: Build architecture-specific Debian packages env: @@ -194,26 +190,26 @@ jobs: run: | set -e set -x - eatmydata git config --global --add safe.directory "${PWD}" - eatmydata debian/configure - eatmydata debian/update-dch-from-git - eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - eatmydata git diff - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only . - eatmydata debuild -us -uc --build=any + git config --global --add safe.directory "${PWD}" + debian/configure + debian/update-dch-from-git + scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION + git diff + apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only . + debuild -us -uc --build=any - name: Test debian packages env: DEBIAN_FRONTEND: noninteractive run: | set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo... - eatmydata adduser --disabled-password --gecos "" testrunner - eatmydata passwd -d testrunner - eatmydata adduser testrunner sudo + apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb + apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo... + adduser --disabled-password --gecos "" testrunner + passwd -d testrunner + adduser testrunner sudo chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner - su -c "eatmydata ./scripts/runtests -p ./tests" testrunner + su -c "./scripts/runtests -p ./tests" testrunner - name: Gather build artifacts run: | set -e @@ -263,10 +259,10 @@ jobs: set -e set -x apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl - eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade + apt-get --yes --quiet -o Acquire::Retries=5 install curl + apt --yes --quiet -o Acquire::Retries=5 upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - uses: actions/checkout@v3 with: @@ -287,11 +283,11 @@ jobs: esac set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common - eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF + apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common + gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base" - eatmydata apt-get --quiet -o Acquire::Retries=5 update + add-apt-repository "deb http://linuxcnc.org $DIST base" + apt-get --quiet -o Acquire::Retries=5 update - name: Build architecture-independent Debian packages env: @@ -301,20 +297,20 @@ jobs: run: | set -e set -x - eatmydata git config --global --add safe.directory "${PWD}" - eatmydata debian/configure - eatmydata debian/update-dch-from-git - eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - eatmydata git diff - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only . - eatmydata debuild -us -uc --build=source,all + git config --global --add safe.directory "${PWD}" + debian/configure + debian/update-dch-from-git + scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION + git diff + apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only . + debuild -us -uc --build=source,all - name: Test install debian packages env: DEBIAN_FRONTEND: noninteractive run: | set -e set -x - eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb + apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb - name: Gather build artifacts run: | set -e From e76ea07b942875502c7fa0d8999477ec35e77652 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 08:18:16 +0200 Subject: [PATCH 02/26] ci: Move to scripts / No need to update Scripts are easyer maintainable and can be tested locally apt upgrade should not be needed: Runner / docker should be up to date --- .github/scripts/add-linuxcnc-repository.sh | 10 ++++++ .github/scripts/install-deps.sh | 10 ++++++ .github/scripts/install-rtai.sh | 15 +++++++++ .github/workflows/ci.yml | 38 ++++------------------ 4 files changed, 42 insertions(+), 31 deletions(-) create mode 100755 .github/scripts/add-linuxcnc-repository.sh create mode 100755 .github/scripts/install-deps.sh create mode 100755 .github/scripts/install-rtai.sh diff --git a/.github/scripts/add-linuxcnc-repository.sh b/.github/scripts/add-linuxcnc-repository.sh new file mode 100755 index 00000000000..1617ec16bd9 --- /dev/null +++ b/.github/scripts/add-linuxcnc-repository.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ trixie base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null +GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) +gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 +gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null +sudo apt-get --quiet update diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh new file mode 100755 index 00000000000..6295a911ead --- /dev/null +++ b/.github/scripts/install-deps.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +sudo apt-get --quiet update +sudo apt-get install -y devscripts equivs build-essential lintian clang --no-install-recommends +debian/configure +sudo apt-get -y build-dep . +sudo apt install -y lintian diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh new file mode 100755 index 00000000000..99fdf2539ef --- /dev/null +++ b/.github/scripts/install-rtai.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +#To install the RTAI deb's from linuxcnc base +#.github/scripts/add-linuxcnc-repository.sh +#sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 +#----- +#To install the RTAI deb's from NTULINUX git +curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb +curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb +curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb +sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb +#----- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 927cab49e17..0e76e9da029 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,7 @@ jobs: - name: Build RIP & test run: | set -x - ./scripts/travis-install-build-deps.sh - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + .github/scripts/install-deps.sh cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-werror @@ -55,27 +53,12 @@ jobs: - name: Build RIP RTAI run: | set -x - #To install the RTAI deb's from linuxcnc base - #echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ trixie base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null - #GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) - #gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 - #gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null - #sudo apt-get --quiet -o Acquire::Retries=5 update - #sudo apt-get --yes -o Acquire::Retries=5 install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 - #----- - #To install the RTAI deb's from NTULINUX git - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb - sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb - #----- - ./scripts/travis-install-build-deps.sh - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + .github/scripts/install-rtai.sh + .github/scripts/install-deps.sh cd src ./autogen.sh - #./configure --with-realtime=/usr/realtime-5.4.279-rtai-amd64 --disable-check-runtime-deps --enable-werror - ./configure --with-realtime=/usr/realtime-5.4.302-rtai-amd64 --disable-check-runtime-deps --enable-werror + #It is save to assume there is only one /usr/realtime-* folder + ./configure --with-realtime=/usr/realtime-* --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 rip-and-test-clang: @@ -93,10 +76,7 @@ jobs: - name: Clang build RIP & test run: | set -x - ./scripts/travis-install-build-deps.sh - sudo apt-get -y -o Acquire::Retries=5 install clang - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + .github/scripts/install-deps.sh cd src ./autogen.sh CC=clang CXX=clang++ ./configure --disable-check-runtime-deps --enable-werror @@ -118,9 +98,7 @@ jobs: - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - name: Build HTML docmentation run: | - ./scripts/travis-install-build-deps.sh - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo apt --yes --quiet -o Acquire::Retries=5 upgrade + .github/scripts/install-deps.sh cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-build-documentation=html @@ -153,7 +131,6 @@ jobs: set -x apt-get --quiet -o Acquire::Retries=5 update apt-get --yes --quiet -o Acquire::Retries=5 install curl - apt --yes --quiet -o Acquire::Retries=5 upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts @@ -260,7 +237,6 @@ jobs: set -x apt-get --quiet -o Acquire::Retries=5 update apt-get --yes --quiet -o Acquire::Retries=5 install curl - apt --yes --quiet -o Acquire::Retries=5 upgrade # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts From 55e07f8f3c523d75758eb83be61f44f0c73c8c3f Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 08:31:58 +0200 Subject: [PATCH 03/26] ci: Split into dependency/build/test --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e76e9da029..20e5790ca60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,16 +27,21 @@ jobs: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Build RIP & test + - name: Install dependencies run: | set -x .github/scripts/install-deps.sh + - name: Build RIP GCC + run: | + set -x cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 - # Note that the package build covers html docs - ../scripts/rip-environment runtests -p + - name: Test + run: | + set -x + scripts/rip-environment runtests -p rip-rtai: runs-on: ubuntu-24.04 @@ -50,11 +55,14 @@ jobs: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Build RIP RTAI + - name: Install dependencies run: | set -x .github/scripts/install-rtai.sh .github/scripts/install-deps.sh + - name: Build RIP RTAI + run: | + set -x cd src ./autogen.sh #It is save to assume there is only one /usr/realtime-* folder @@ -73,16 +81,21 @@ jobs: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Clang build RIP & test + - name: Install dependencies run: | set -x .github/scripts/install-deps.sh + - name: Build RIP Clang + run: | + set -x cd src ./autogen.sh CC=clang CXX=clang++ ./configure --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 - # Note that the package build covers html docs - ../scripts/rip-environment runtests -p + - name: Test + run: | + set -x + scripts/rip-environment runtests -p htmldocs: runs-on: ubuntu-24.04 @@ -96,9 +109,13 @@ jobs: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* - - name: Build HTML docmentation + - name: Install dependencies run: | + set -x .github/scripts/install-deps.sh + - name: Build HTML docmentation + run: | + set -x cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-build-documentation=html From 0ca6ae8aecf4963f184f9263bb8d78174d666bc3 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 09:45:44 +0200 Subject: [PATCH 04/26] ci: Update to actions/checkout@v6 / don't fetch all There is no reason to fetch all for test builds There are no submodules, so deactivated --- .github/workflows/ci.yml | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20e5790ca60..26b765c277c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,10 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* + submodules: false + fetch-depth: 1 - name: Install dependencies run: | set -x @@ -50,11 +49,10 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* + submodules: false + fetch-depth: 1 - name: Install dependencies run: | set -x @@ -76,11 +74,10 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* + submodules: false + fetch-depth: 1 - name: Install dependencies run: | set -x @@ -104,11 +101,10 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 - - run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/* + submodules: false + fetch-depth: 1 - name: Install dependencies run: | set -x @@ -151,8 +147,9 @@ jobs: # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: + submodules: false # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 @@ -257,8 +254,9 @@ jobs: # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: + submodules: false # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 @@ -333,10 +331,10 @@ jobs: cppcheck: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: - submodules: true - fetch-depth: 0 + submodules: false + fetch-depth: 1 - name: Perform Source Code checks that were successful in the past continue-on-error: true run: | From b57db698b6ba4de21a3f15eb729693268e45b1f5 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 09:54:40 +0200 Subject: [PATCH 05/26] ci: Move cppcheck up, so all testing is at the same place --- .github/workflows/ci.yml | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26b765c277c..07a5f5d68c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,6 +94,25 @@ jobs: set -x scripts/rip-environment runtests -p + cppcheck: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + with: + submodules: false + fetch-depth: 1 + - name: Perform Source Code checks that were successful in the past + continue-on-error: true + run: | + set -x + git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* + sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck + scripts/cppcheck.sh + - name: Shellcheck + continue-on-error: true + run: | + scripts/shellcheck.sh + htmldocs: runs-on: ubuntu-24.04 steps: @@ -327,27 +346,6 @@ jobs: path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} if-no-files-found: error - - cppcheck: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - with: - submodules: false - fetch-depth: 1 - - name: Perform Source Code checks that were successful in the past - continue-on-error: true - run: | - set -x - git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* - sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck - scripts/cppcheck.sh - - name: Shellcheck - continue-on-error: true - run: | - scripts/shellcheck.sh - - release: name: Release packages needs: From 068877ef6c94cbee99931e4b749d1ba94b6dfa76 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 10:01:28 +0200 Subject: [PATCH 06/26] ci: actions/upload-artifact@v7 / actions/download-artifact@v8 The old ones are outdated and will be removed as mentioned by the warning in the actions tab. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a5f5d68c6..8cc0e301707 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,7 +239,7 @@ jobs: echo "arch=$(dpkg --print-architecture)" >> $GITHUB_OUTPUT - name: Upload build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linuxcnc-${{ steps.meta.outputs.dist }}-${{ steps.meta.outputs.arch }} path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} @@ -340,7 +340,7 @@ jobs: echo "arch=all" >> $GITHUB_OUTPUT - name: Upload build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linuxcnc-${{ steps.meta.outputs.dist }}-${{ steps.meta.outputs.arch }} path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} @@ -357,7 +357,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: release_artifacts - name: Prepare upload assets From 13b86ce7366805d85e030cb4dfed9bc81967a217 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 11:06:02 +0200 Subject: [PATCH 07/26] ci: Set docker to 4 cpu's --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cc0e301707..e4e9d09de5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: image: ${{ matrix.image }} # IPC_OWNER is needed for shmget IPC_CREAT # SYS_ADMIN is needed for shmctl IPC_SET - options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN + options: --cpus=4 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN steps: - name: Dump GitHub context env: @@ -255,7 +255,7 @@ jobs: image: ${{ matrix.image }} # IPC_OWNER is needed for shmget IPC_CREAT # SYS_ADMIN is needed for shmctl IPC_SET - options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN + options: --cpus=4 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN steps: - name: Dump GitHub context env: From d684a5bdcd92a2a898e0116e7d33d1da693b4dc5 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Thu, 30 Apr 2026 14:09:04 +0200 Subject: [PATCH 08/26] ci: --cpus should not be needed at all This will run the number of available CPU's Add number of cpu output --- .github/workflows/ci.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4e9d09de5e..1effdcd7760 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,9 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - uses: actions/checkout@v6 with: submodules: false @@ -48,7 +50,9 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - uses: actions/checkout@v6 with: submodules: false @@ -73,7 +77,9 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - uses: actions/checkout@v6 with: submodules: false @@ -119,7 +125,9 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - uses: actions/checkout@v6 with: submodules: false @@ -149,12 +157,14 @@ jobs: image: ${{ matrix.image }} # IPC_OWNER is needed for shmget IPC_CREAT # SYS_ADMIN is needed for shmctl IPC_SET - options: --cpus=4 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN + options: --cap-add=IPC_OWNER --cap-add=SYS_ADMIN steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - name: Install pre-dependencies env: DEBIAN_FRONTEND: noninteractive @@ -255,12 +265,14 @@ jobs: image: ${{ matrix.image }} # IPC_OWNER is needed for shmget IPC_CREAT # SYS_ADMIN is needed for shmctl IPC_SET - options: --cpus=4 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN + options: --cap-add=IPC_OWNER --cap-add=SYS_ADMIN steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" - name: Install pre-dependencies env: From 65e11ba8337d55aa3dab1a01e7cd221957f23188 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Fri, 1 May 2026 13:37:11 +0200 Subject: [PATCH 09/26] ci: Fix --- .github/scripts/install-deps.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh index 6295a911ead..f60e0864598 100755 --- a/.github/scripts/install-deps.sh +++ b/.github/scripts/install-deps.sh @@ -7,4 +7,3 @@ sudo apt-get --quiet update sudo apt-get install -y devscripts equivs build-essential lintian clang --no-install-recommends debian/configure sudo apt-get -y build-dep . -sudo apt install -y lintian From 65d7e87d7e98c65cd1b257a80a064d7398b5f9bf Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 01:51:18 +0200 Subject: [PATCH 10/26] ci: Merge to old ci --- .github/workflows/ci.yml | 104 +++++++++++---------------------------- 1 file changed, 28 insertions(+), 76 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1effdcd7760..b421918c9ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,8 @@ jobs: run: | echo Number of CPUs: $(nproc) echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false fetch-depth: 1 @@ -60,7 +61,7 @@ jobs: - name: Install dependencies run: | set -x - .github/scripts/install-rtai.sh + .github/scripts/install-rtai.sh trixie .github/scripts/install-deps.sh - name: Build RIP RTAI run: | @@ -107,12 +108,12 @@ jobs: with: submodules: false fetch-depth: 1 - - name: Perform Source Code checks that were successful in the past + - name: Cppcheck continue-on-error: true run: | set -x - git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/* - sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck + apt-get -q update + sudo apt-get -y install cppcheck shellcheck scripts/cppcheck.sh - name: Shellcheck continue-on-error: true @@ -169,62 +170,43 @@ jobs: env: DEBIAN_FRONTEND: noninteractive run: | - set -e set -x - apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install curl - # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts + apt-get -q update + # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package and run tests. + apt-get -y install curl git lsb-release python3 devscripts sudo --no-install-recommends - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 - - - name: Add linuxcnc.org deb archive - env: - DEBIAN_FRONTEND: noninteractive - run: | - case "${{matrix.image}}" in - debian:sid|debian:bookworm|debian:trixie) - exit 0 - ;; - *) - ;; - esac - set -e - set -x - apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common - gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF - DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - add-apt-repository "deb http://linuxcnc.org $DIST base" - apt-get --quiet -o Acquire::Retries=5 update - - name: Build architecture-specific Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot DEBIAN_FRONTEND: noninteractive run: | - set -e set -x - git config --global --add safe.directory "${PWD}" + git config --global --add safe.directory ${PWD} debian/configure debian/update-dch-from-git scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION git diff - apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only . + apt-get -y build-dep --arch-only . debuild -us -uc --build=any + - name: Install debian packages + env: + DEBIAN_FRONTEND: noninteractive + run: | + set -x + apt-get -y install ../*.deb --no-install-recommends - name: Test debian packages env: DEBIAN_FRONTEND: noninteractive run: | - set -e set -x - apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb - apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo... adduser --disabled-password --gecos "" testrunner passwd -d testrunner adduser testrunner sudo @@ -232,7 +214,6 @@ jobs: su -c "./scripts/runtests -p ./tests" testrunner - name: Gather build artifacts run: | - set -e set -x ARCH=$(dpkg --print-architecture) DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) @@ -247,7 +228,6 @@ jobs: run: | echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT echo "arch=$(dpkg --print-architecture)" >> $GITHUB_OUTPUT - - name: Upload build artifacts uses: actions/upload-artifact@v7 with: @@ -255,7 +235,6 @@ jobs: path: artifacts/${{ steps.meta.outputs.dist }}/${{ steps.meta.outputs.arch }} if-no-files-found: error - package-indep: runs-on: ubuntu-24.04 strategy: @@ -278,67 +257,41 @@ jobs: env: DEBIAN_FRONTEND: noninteractive run: | - set -e set -x - apt-get --quiet -o Acquire::Retries=5 update - apt-get --yes --quiet -o Acquire::Retries=5 install curl + apt-get -q update # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. - apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts - + apt-get -y install curl git lsb-release python3 devscripts --no-install-recommends - uses: actions/checkout@v6 with: submodules: false # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 - - - name: Add linuxcnc.org deb archive - env: - DEBIAN_FRONTEND: noninteractive - run: | - case "${{matrix.image}}" in - debian:sid|debian:bookworm|debian:trixie) - exit 0 - ;; - *) - ;; - esac - set -e - set -x - apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common - gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF - DIST=$(echo ${{matrix.image}} | cut -d : -f 2) - add-apt-repository "deb http://linuxcnc.org $DIST base" - apt-get --quiet -o Acquire::Retries=5 update - - name: Build architecture-independent Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot DEBIAN_FRONTEND: noninteractive run: | - set -e set -x - git config --global --add safe.directory "${PWD}" + git config --global --add safe.directory ${PWD} debian/configure debian/update-dch-from-git scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION git diff - apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only . + apt-get -y build-dep --indep-only . debuild -us -uc --build=source,all - - name: Test install debian packages + - name: Install debian packages env: DEBIAN_FRONTEND: noninteractive run: | - set -e set -x - apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb + apt-get -y install ../*.deb --no-install-recommends - name: Gather build artifacts run: | - set -e set -x - DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) ARCH=all + DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) OUTDIR="artifacts/${DIST}/${ARCH}" mkdir -p "$OUTDIR" cp -v $(find .. -maxdepth 1 -type f | LC_ALL=C sort) "$OUTDIR" || true @@ -350,7 +303,6 @@ jobs: run: | echo "dist=$(echo ${{ matrix.image }} | cut -d : -f 2)" >> $GITHUB_OUTPUT echo "arch=all" >> $GITHUB_OUTPUT - - name: Upload build artifacts uses: actions/upload-artifact@v7 with: @@ -374,7 +326,7 @@ jobs: path: release_artifacts - name: Prepare upload assets run: | - set -e + set -x mkdir -p upload echo "Downloaded artifacts layout:" && find release_artifacts -maxdepth 3 -print | sed 's/^/ /' for d in release_artifacts/*; do @@ -396,7 +348,7 @@ jobs: echo "Upload dir contents:" && ls -l "upload/${dist}-${arch}" | sed 's/^/ /' done - name: Create GitHub Release and upload assets - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: files: | upload/* From 77961690596edacbe6dcf99bec7bcb458157026f Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 13:27:37 +0200 Subject: [PATCH 11/26] ci: Define DEBIAN_FRONTEND only once --- .github/workflows/ci.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b421918c9ce..7c70d9b9a86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,9 @@ on: permissions: contents: read # to fetch code (actions/checkout) +env: + DEBIAN_FRONTEND: noninteractive + jobs: rip-and-test: @@ -167,8 +170,6 @@ jobs: echo Number of CPUs: $(nproc) echo "$GITHUB_CONTEXT" - name: Install pre-dependencies - env: - DEBIAN_FRONTEND: noninteractive run: | set -x apt-get -q update @@ -186,7 +187,6 @@ jobs: env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot - DEBIAN_FRONTEND: noninteractive run: | set -x git config --global --add safe.directory ${PWD} @@ -197,14 +197,10 @@ jobs: apt-get -y build-dep --arch-only . debuild -us -uc --build=any - name: Install debian packages - env: - DEBIAN_FRONTEND: noninteractive run: | set -x apt-get -y install ../*.deb --no-install-recommends - name: Test debian packages - env: - DEBIAN_FRONTEND: noninteractive run: | set -x adduser --disabled-password --gecos "" testrunner @@ -254,8 +250,6 @@ jobs: echo "$GITHUB_CONTEXT" - name: Install pre-dependencies - env: - DEBIAN_FRONTEND: noninteractive run: | set -x apt-get -q update @@ -271,7 +265,6 @@ jobs: env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot - DEBIAN_FRONTEND: noninteractive run: | set -x git config --global --add safe.directory ${PWD} @@ -282,8 +275,6 @@ jobs: apt-get -y build-dep --indep-only . debuild -us -uc --build=source,all - name: Install debian packages - env: - DEBIAN_FRONTEND: noninteractive run: | set -x apt-get -y install ../*.deb --no-install-recommends From 48e60e81196675be7d901ea207177acaf108e215 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 13:32:42 +0200 Subject: [PATCH 12/26] ci: Fix --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c70d9b9a86..391767f3796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,12 +111,15 @@ jobs: with: submodules: false fetch-depth: 1 + - name: Install dependencies + run: | + set -x + sudo apt-get -q update + sudo apt-get -y install cppcheck shellcheck - name: Cppcheck continue-on-error: true run: | set -x - apt-get -q update - sudo apt-get -y install cppcheck shellcheck scripts/cppcheck.sh - name: Shellcheck continue-on-error: true From 725749fa42881b5ae19ab64759a9c574c91b2963 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 13:37:26 +0200 Subject: [PATCH 13/26] ci: Merge docker prototyping --- .github/scripts/add-linuxcnc-repository.sh | 17 +++++++++++++---- .github/scripts/install-rtai.sh | 4 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/scripts/add-linuxcnc-repository.sh b/.github/scripts/add-linuxcnc-repository.sh index 1617ec16bd9..37da2cf579e 100755 --- a/.github/scripts/add-linuxcnc-repository.sh +++ b/.github/scripts/add-linuxcnc-repository.sh @@ -3,8 +3,17 @@ set -eu #Needed so CI fails when anything is wrong set -x -echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ trixie base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null -GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) -gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 -gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null +DIST=$1 + +echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/linuxcnc.gpg] https://www.linuxcnc.org/ $DIST base" | sudo tee /etc/apt/sources.list.d/linuxcnc.list > /dev/null +case $DIST in + 'buster' | 'bullseye' | 'bookworm') + gpg --homedir "${PWD}/gnupg" --export 3CB9FD148F374FEF | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null + ;; + *) + GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) + gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 + gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null + ;; +esac sudo apt-get --quiet update diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh index 99fdf2539ef..3be1e3b0ce6 100755 --- a/.github/scripts/install-rtai.sh +++ b/.github/scripts/install-rtai.sh @@ -3,8 +3,10 @@ set -eu #Needed so CI fails when anything is wrong set -x +DIST=$1 + #To install the RTAI deb's from linuxcnc base -#.github/scripts/add-linuxcnc-repository.sh +#.github/scripts/add-linuxcnc-repository.sh $DIST #sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 #----- #To install the RTAI deb's from NTULINUX git From eb7e481df2aa216cea9918d136b62ef4a14b14b3 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 14:07:06 +0200 Subject: [PATCH 14/26] ci: Add missing package --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 391767f3796..abf376a1d32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,8 +177,7 @@ jobs: set -x apt-get -q update # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package and run tests. - apt-get -y install curl git lsb-release python3 devscripts sudo --no-install-recommends - + apt-get -y install curl git lsb-release python3 devscripts sudo xauth --no-install-recommends - name: Checkout repository uses: actions/checkout@v6 with: @@ -251,7 +250,6 @@ jobs: run: | echo Number of CPUs: $(nproc) echo "$GITHUB_CONTEXT" - - name: Install pre-dependencies run: | set -x From 28fa38372f51f9a7ac2ed70c250f27bcc3a41c4a Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 21:40:50 +0200 Subject: [PATCH 15/26] ci: Verify clean --- .github/scripts/check-clean-repo.sh | 9 +++++++++ .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 .github/scripts/check-clean-repo.sh diff --git a/.github/scripts/check-clean-repo.sh b/.github/scripts/check-clean-repo.sh new file mode 100755 index 00000000000..62e708c674d --- /dev/null +++ b/.github/scripts/check-clean-repo.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong + +if [ -n "$(git status --porcelain)" ]; then + echo "Build produced untracked or modified files:" + git status --porcelain + exit 1 +fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abf376a1d32..59c9e3a409f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,10 @@ jobs: ./autogen.sh ./configure --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 + - name: Verify no untracked or modified files after build + continue-on-error: true + run: | + .github/scripts/check-clean-repo.sh - name: Test run: | set -x @@ -74,6 +78,10 @@ jobs: #It is save to assume there is only one /usr/realtime-* folder ./configure --with-realtime=/usr/realtime-* --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 + - name: Verify no untracked or modified files after build + continue-on-error: true + run: | + .github/scripts/check-clean-repo.sh rip-and-test-clang: runs-on: ubuntu-24.04 @@ -99,6 +107,10 @@ jobs: ./autogen.sh CC=clang CXX=clang++ ./configure --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 + - name: Verify no untracked or modified files after build + continue-on-error: true + run: | + .github/scripts/check-clean-repo.sh - name: Test run: | set -x @@ -153,6 +165,10 @@ jobs: make -O -j$((1+$(nproc))) translateddocs make -O -j$((1+$(nproc))) docs # Note that the package build covers html docs + - name: Verify no untracked or modified files after build + continue-on-error: true + run: | + .github/scripts/check-clean-repo.sh package-arch: runs-on: ${{ matrix.runner }} @@ -198,6 +214,10 @@ jobs: git diff apt-get -y build-dep --arch-only . debuild -us -uc --build=any + - name: Verify no untracked or modified files after build + continue-on-error: true + run: | + .github/scripts/check-clean-repo.sh - name: Install debian packages run: | set -x @@ -275,6 +295,10 @@ jobs: git diff apt-get -y build-dep --indep-only . debuild -us -uc --build=source,all + - name: Verify no untracked or modified files after build + continue-on-error: true + run: | + .github/scripts/check-clean-repo.sh - name: Install debian packages run: | set -x From c951a9b554151f70fe583d5f8716d3e679064e11 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sat, 2 May 2026 22:09:59 +0200 Subject: [PATCH 16/26] ci: Check clean with exclude / Fix .gitignore / Enforce --- .github/scripts/check-clean-repo.sh | 9 -------- .github/scripts/install-rtai.sh | 16 ++++++++++---- .github/scripts/verify-clean-repo.sh | 33 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 18 +++++---------- 4 files changed, 51 insertions(+), 25 deletions(-) delete mode 100755 .github/scripts/check-clean-repo.sh create mode 100755 .github/scripts/verify-clean-repo.sh diff --git a/.github/scripts/check-clean-repo.sh b/.github/scripts/check-clean-repo.sh deleted file mode 100755 index 62e708c674d..00000000000 --- a/.github/scripts/check-clean-repo.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -eu #Needed so CI fails when anything is wrong - -if [ -n "$(git status --porcelain)" ]; then - echo "Build produced untracked or modified files:" - git status --porcelain - exit 1 -fi diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh index 3be1e3b0ce6..1f43bbc64f9 100755 --- a/.github/scripts/install-rtai.sh +++ b/.github/scripts/install-rtai.sh @@ -10,8 +10,16 @@ DIST=$1 #sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 #----- #To install the RTAI deb's from NTULINUX git -curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb -curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb -curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb -sudo dpkg -i linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb +TMPDIR=$(mktemp -d) +( + cd $TMPDIR + curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb +) +sudo dpkg -i \ + $TMPDIR/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb \ + $TMPDIR/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb \ + $TMPDIR/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb +rm -rf $TMPDIR #----- diff --git a/.github/scripts/verify-clean-repo.sh b/.github/scripts/verify-clean-repo.sh new file mode 100755 index 00000000000..05a3a972c30 --- /dev/null +++ b/.github/scripts/verify-clean-repo.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong + +if [ $# -eq 1 ]; then + EXCLUDE_REGEXP=$1 + + if [ -n "$(git status -u --porcelain | grep -v -E "$EXCLUDE_REGEXP")" ]; then + echo "Build produced untracked or modified files:----------------------------------------" + git status -u --porcelain | grep -v -E "$EXCLUDE_REGEXP" || true + echo "-----------------------------------------------------------------------------------" + echo "Exclude regexp is: "$EXCLUDE_REGEXP", the following files are not checked:---------" + git status -u --porcelain | grep -E "$EXCLUDE_REGEXP" || true + echo "-----------------------------------------------------------------------------------" + exit 1 + else + echo Repo is clean + echo "Exclude regexp is: "$EXCLUDE_REGEXP", the following files are not checked:" + git status -u --porcelain | grep -E "$EXCLUDE_REGEXP" || true + echo "-----------------------------------------------------------------------------------" + exit 0 + fi +else + if [ -n "$(git status -u --porcelain)" ]; then + echo "Build produced untracked or modified files, nothing excluded:----------------------" + git status -u --porcelain + echo "-----------------------------------------------------------------------------------" + exit 1 + else + echo Repo is clean + exit 0 + fi +fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59c9e3a409f..0ef71f75b3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,8 @@ jobs: ./configure --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 - name: Verify no untracked or modified files after build - continue-on-error: true run: | - .github/scripts/check-clean-repo.sh + .github/scripts/verify-clean-repo.sh - name: Test run: | set -x @@ -79,9 +78,8 @@ jobs: ./configure --with-realtime=/usr/realtime-* --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 - name: Verify no untracked or modified files after build - continue-on-error: true run: | - .github/scripts/check-clean-repo.sh + .github/scripts/verify-clean-repo.sh rip-and-test-clang: runs-on: ubuntu-24.04 @@ -108,9 +106,8 @@ jobs: CC=clang CXX=clang++ ./configure --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 - name: Verify no untracked or modified files after build - continue-on-error: true run: | - .github/scripts/check-clean-repo.sh + .github/scripts/verify-clean-repo.sh - name: Test run: | set -x @@ -166,9 +163,8 @@ jobs: make -O -j$((1+$(nproc))) docs # Note that the package build covers html docs - name: Verify no untracked or modified files after build - continue-on-error: true run: | - .github/scripts/check-clean-repo.sh + .github/scripts/verify-clean-repo.sh package-arch: runs-on: ${{ matrix.runner }} @@ -215,9 +211,8 @@ jobs: apt-get -y build-dep --arch-only . debuild -us -uc --build=any - name: Verify no untracked or modified files after build - continue-on-error: true run: | - .github/scripts/check-clean-repo.sh + .github/scripts/verify-clean-repo.sh "VERSION|debian/changelog" - name: Install debian packages run: | set -x @@ -296,9 +291,8 @@ jobs: apt-get -y build-dep --indep-only . debuild -us -uc --build=source,all - name: Verify no untracked or modified files after build - continue-on-error: true run: | - .github/scripts/check-clean-repo.sh + .github/scripts/verify-clean-repo.sh "VERSION|debian/changelog" - name: Install debian packages run: | set -x From ae17b95763b62da511e608e6cef1a041378cddf3 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 09:44:24 +0200 Subject: [PATCH 17/26] ci: Use improved regexp / continue-on-error true for html docs and indep --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ef71f75b3f..1d66477d8d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,6 +163,7 @@ jobs: make -O -j$((1+$(nproc))) docs # Note that the package build covers html docs - name: Verify no untracked or modified files after build + continue-on-error: true #ToDo: Check what to do with the changed .po files run: | .github/scripts/verify-clean-repo.sh @@ -212,7 +213,7 @@ jobs: debuild -us -uc --build=any - name: Verify no untracked or modified files after build run: | - .github/scripts/verify-clean-repo.sh "VERSION|debian/changelog" + .github/scripts/verify-clean-repo.sh '^.{3}(VERSION|debian\/changelog)$' - name: Install debian packages run: | set -x @@ -291,8 +292,9 @@ jobs: apt-get -y build-dep --indep-only . debuild -us -uc --build=source,all - name: Verify no untracked or modified files after build + continue-on-error: true #ToDo: Check what to do with the changed .po files run: | - .github/scripts/verify-clean-repo.sh "VERSION|debian/changelog" + .github/scripts/verify-clean-repo.sh '^.{3}(VERSION|debian\/changelog)$' - name: Install debian packages run: | set -x From c23bcda4ece7f382c1101083ce08298057fbbefc Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 09:55:57 +0200 Subject: [PATCH 18/26] ci: Change from regexp to pathspec --- .github/scripts/verify-clean-repo.sh | 16 +++++++--------- .github/workflows/ci.yml | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/scripts/verify-clean-repo.sh b/.github/scripts/verify-clean-repo.sh index 05a3a972c30..e1e59f2488c 100755 --- a/.github/scripts/verify-clean-repo.sh +++ b/.github/scripts/verify-clean-repo.sh @@ -2,21 +2,19 @@ set -eu #Needed so CI fails when anything is wrong -if [ $# -eq 1 ]; then - EXCLUDE_REGEXP=$1 - - if [ -n "$(git status -u --porcelain | grep -v -E "$EXCLUDE_REGEXP")" ]; then +if [ $# -gt 0 ]; then + if [ -n "$(git status -u --porcelain -- $@)" ]; then echo "Build produced untracked or modified files:----------------------------------------" - git status -u --porcelain | grep -v -E "$EXCLUDE_REGEXP" || true + git status -u --porcelain -- $@ echo "-----------------------------------------------------------------------------------" - echo "Exclude regexp is: "$EXCLUDE_REGEXP", the following files are not checked:---------" - git status -u --porcelain | grep -E "$EXCLUDE_REGEXP" || true + echo "Pathspec is: \"$@\", withouth pathspec:--------------------------------------------" + git status -u --porcelain echo "-----------------------------------------------------------------------------------" exit 1 else echo Repo is clean - echo "Exclude regexp is: "$EXCLUDE_REGEXP", the following files are not checked:" - git status -u --porcelain | grep -E "$EXCLUDE_REGEXP" || true + echo "Pathspec is: \"$@\", withouth pathspec:--------------------------------------------" + git status -u --porcelain echo "-----------------------------------------------------------------------------------" exit 0 fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d66477d8d6..4d76c41b9dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,7 +213,7 @@ jobs: debuild -us -uc --build=any - name: Verify no untracked or modified files after build run: | - .github/scripts/verify-clean-repo.sh '^.{3}(VERSION|debian\/changelog)$' + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' - name: Install debian packages run: | set -x @@ -294,7 +294,7 @@ jobs: - name: Verify no untracked or modified files after build continue-on-error: true #ToDo: Check what to do with the changed .po files run: | - .github/scripts/verify-clean-repo.sh '^.{3}(VERSION|debian\/changelog)$' + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' - name: Install debian packages run: | set -x From 29cd5c347069004f4110dc3bdacb7bddc00fab5b Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 12:05:51 +0200 Subject: [PATCH 19/26] ci: Add names where still missing --- .github/workflows/ci.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d76c41b9dc..c499d591b1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,8 @@ jobs: run: | echo Number of CPUs: $(nproc) echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false fetch-depth: 1 @@ -90,7 +91,8 @@ jobs: run: | echo Number of CPUs: $(nproc) echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false fetch-depth: 1 @@ -116,7 +118,8 @@ jobs: cppcheck: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false fetch-depth: 1 @@ -144,7 +147,8 @@ jobs: run: | echo Number of CPUs: $(nproc) echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false fetch-depth: 1 @@ -272,7 +276,8 @@ jobs: apt-get -q update # Install stuff needed to check out the linuxcnc repo and turn it into a debian source package. apt-get -y install curl git lsb-release python3 devscripts --no-install-recommends - - uses: actions/checkout@v6 + - name: Checkout repository + uses: actions/checkout@v6 with: submodules: false # "fetch-depth: 0" fetches all of history, this is needed by From aecd47b714598b949866d1ad91b1a3eedbaf72ec Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 12:24:57 +0200 Subject: [PATCH 20/26] ci: Move more build steps to scripts Advantage: Reusable / Can be run locally --- .github/scripts/build-doc.sh | 12 +++++++++ .github/scripts/build-package-arch.sh | 11 ++++++++ .github/scripts/build-package-indep.sh | 11 ++++++++ .github/scripts/build-rip.sh | 11 ++++++++ .github/workflows/ci.yml | 37 +++++--------------------- 5 files changed, 51 insertions(+), 31 deletions(-) create mode 100755 .github/scripts/build-doc.sh create mode 100755 .github/scripts/build-package-arch.sh create mode 100755 .github/scripts/build-package-indep.sh create mode 100755 .github/scripts/build-rip.sh diff --git a/.github/scripts/build-doc.sh b/.github/scripts/build-doc.sh new file mode 100755 index 00000000000..12dea6b7650 --- /dev/null +++ b/.github/scripts/build-doc.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +cd src +./autogen.sh +./configure --disable-check-runtime-deps --enable-build-documentation=html +make -O -j$((1+$(nproc))) manpages +make -O -j$((1+$(nproc))) translateddocs +make -O -j$((1+$(nproc))) docs +# Note that the package build covers html docs diff --git a/.github/scripts/build-package-arch.sh b/.github/scripts/build-package-arch.sh new file mode 100755 index 00000000000..672f4e3980b --- /dev/null +++ b/.github/scripts/build-package-arch.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +debian/configure +debian/update-dch-from-git +scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION +git diff +apt-get -y build-dep --arch-only . +debuild -us -uc --build=any diff --git a/.github/scripts/build-package-indep.sh b/.github/scripts/build-package-indep.sh new file mode 100755 index 00000000000..adb83860d68 --- /dev/null +++ b/.github/scripts/build-package-indep.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +debian/configure +debian/update-dch-from-git +scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION +git diff +apt-get -y build-dep --indep-only . +debuild -us -uc --build=source,all diff --git a/.github/scripts/build-rip.sh b/.github/scripts/build-rip.sh new file mode 100755 index 00000000000..4d7d0386a1a --- /dev/null +++ b/.github/scripts/build-rip.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +#Any arguments are passed to configure + +cd src +./autogen.sh +./configure $@ --disable-check-runtime-deps --enable-werror +make -O -j$((1+$(nproc))) default pycheck V=1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c499d591b1f..17aa29eab26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,7 @@ jobs: - name: Build RIP GCC run: | set -x - cd src - ./autogen.sh - ./configure --disable-check-runtime-deps --enable-werror - make -O -j$((1+$(nproc))) default pycheck V=1 + .github/scripts/build-rip.sh - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh @@ -73,11 +70,8 @@ jobs: - name: Build RIP RTAI run: | set -x - cd src - ./autogen.sh #It is save to assume there is only one /usr/realtime-* folder - ./configure --with-realtime=/usr/realtime-* --disable-check-runtime-deps --enable-werror - make -O -j$((1+$(nproc))) default pycheck V=1 + .github/scripts/build-rip.sh --with-realtime=/usr/realtime-* - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh @@ -103,10 +97,7 @@ jobs: - name: Build RIP Clang run: | set -x - cd src - ./autogen.sh - CC=clang CXX=clang++ ./configure --disable-check-runtime-deps --enable-werror - make -O -j$((1+$(nproc))) default pycheck V=1 + CC=clang CXX=clang++ .github/scripts/build-rip.sh - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh @@ -159,13 +150,7 @@ jobs: - name: Build HTML docmentation run: | set -x - cd src - ./autogen.sh - ./configure --disable-check-runtime-deps --enable-build-documentation=html - make -O -j$((1+$(nproc))) manpages - make -O -j$((1+$(nproc))) translateddocs - make -O -j$((1+$(nproc))) docs - # Note that the package build covers html docs + .github/scripts/build-doc.sh - name: Verify no untracked or modified files after build continue-on-error: true #ToDo: Check what to do with the changed .po files run: | @@ -209,12 +194,7 @@ jobs: run: | set -x git config --global --add safe.directory ${PWD} - debian/configure - debian/update-dch-from-git - scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - git diff - apt-get -y build-dep --arch-only . - debuild -us -uc --build=any + .github/scripts/build-package-arch.sh - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' @@ -290,12 +270,7 @@ jobs: run: | set -x git config --global --add safe.directory ${PWD} - debian/configure - debian/update-dch-from-git - scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION - git diff - apt-get -y build-dep --indep-only . - debuild -us -uc --build=source,all + .github/scripts/build-package-indep.sh - name: Verify no untracked or modified files after build continue-on-error: true #ToDo: Check what to do with the changed .po files run: | From 64f31f31278bf9175a2e3720ca12e6bceb7b5052 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 18:21:54 +0200 Subject: [PATCH 21/26] ci: Add clean check after test --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17aa29eab26..044b5669531 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,9 @@ jobs: run: | set -x scripts/rip-environment runtests -p + - name: Verify no untracked or modified files after test + run: | + .github/scripts/verify-clean-repo.sh rip-rtai: runs-on: ubuntu-24.04 @@ -105,6 +108,9 @@ jobs: run: | set -x scripts/rip-environment runtests -p + - name: Verify no untracked or modified files after test + run: | + .github/scripts/verify-clean-repo.sh cppcheck: runs-on: ubuntu-24.04 @@ -210,6 +216,9 @@ jobs: adduser testrunner sudo chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner su -c "./scripts/runtests -p ./tests" testrunner + - name: Verify no untracked or modified files after test + run: | + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' - name: Gather build artifacts run: | set -x From 41e0c091971b0758c1a01e21768bb00c49c53fe5 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 18:39:17 +0200 Subject: [PATCH 22/26] ci: Quiet curl / Doc verify-clean-repo --- .github/scripts/install-rtai.sh | 6 +++--- .github/scripts/verify-clean-repo.sh | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh index 1f43bbc64f9..69a590c55b5 100755 --- a/.github/scripts/install-rtai.sh +++ b/.github/scripts/install-rtai.sh @@ -13,9 +13,9 @@ DIST=$1 TMPDIR=$(mktemp -d) ( cd $TMPDIR - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb ) sudo dpkg -i \ $TMPDIR/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb \ diff --git a/.github/scripts/verify-clean-repo.sh b/.github/scripts/verify-clean-repo.sh index e1e59f2488c..60197075575 100755 --- a/.github/scripts/verify-clean-repo.sh +++ b/.github/scripts/verify-clean-repo.sh @@ -3,6 +3,7 @@ set -eu #Needed so CI fails when anything is wrong if [ $# -gt 0 ]; then + #Arguments are pathspecs for git status, used to exclude files for this test if [ -n "$(git status -u --porcelain -- $@)" ]; then echo "Build produced untracked or modified files:----------------------------------------" git status -u --porcelain -- $@ @@ -19,8 +20,9 @@ if [ $# -gt 0 ]; then exit 0 fi else + #No arguments: Test all files if [ -n "$(git status -u --porcelain)" ]; then - echo "Build produced untracked or modified files, nothing excluded:----------------------" + echo "Build produced untracked or modified files:----------------------------------------" git status -u --porcelain echo "-----------------------------------------------------------------------------------" exit 1 From 65465bde3f5544f5a659d5e40adb102d93a3add4 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 20:07:54 +0200 Subject: [PATCH 23/26] ci: Add --with-realtime=uspace Default ist RTAI. No issue so far but when RTAI, this is built --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 044b5669531..ad190820973 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - name: Build RIP GCC run: | set -x - .github/scripts/build-rip.sh + .github/scripts/build-rip.sh --with-realtime=uspace - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh @@ -100,7 +100,7 @@ jobs: - name: Build RIP Clang run: | set -x - CC=clang CXX=clang++ .github/scripts/build-rip.sh + CC=clang CXX=clang++ .github/scripts/build-rip.sh --with-realtime=uspace - name: Verify no untracked or modified files after build run: | .github/scripts/verify-clean-repo.sh From b5e8eb159047098c586e77ac36020f4aab478c8c Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 21:01:35 +0200 Subject: [PATCH 24/26] ci: Ignore *.po / documentation.pot but make check hard fail --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad190820973..1fa6559f485 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,9 +158,9 @@ jobs: set -x .github/scripts/build-doc.sh - name: Verify no untracked or modified files after build - continue-on-error: true #ToDo: Check what to do with the changed .po files run: | - .github/scripts/verify-clean-repo.sh + #*.po and documentation.pot are modifyed by build. Ignore them for now. + .github/scripts/verify-clean-repo.sh ':(exclude)docs/po/*.po' ':(exclude)docs/po/documentation.pot' package-arch: runs-on: ${{ matrix.runner }} @@ -281,9 +281,9 @@ jobs: git config --global --add safe.directory ${PWD} .github/scripts/build-package-indep.sh - name: Verify no untracked or modified files after build - continue-on-error: true #ToDo: Check what to do with the changed .po files run: | - .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' + #*.po and documentation.pot are modifyed by build. Ignore them for now. + .github/scripts/verify-clean-repo.sh ':(exclude)VERSION' ':(exclude)debian/changelog' ':(exclude)docs/po/*.po' ':(exclude)docs/po/documentation.pot' - name: Install debian packages run: | set -x From 80adb5adbba6d5c243353288d3fbb9e76d77f483 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Sun, 3 May 2026 22:07:25 +0200 Subject: [PATCH 25/26] ci: Fix shellcheck issues --- .github/scripts/add-linuxcnc-repository.sh | 4 +-- .github/scripts/build-rip.sh | 2 +- .github/scripts/install-rtai.sh | 37 +++++++++++----------- .github/scripts/verify-clean-repo.sh | 8 ++--- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/scripts/add-linuxcnc-repository.sh b/.github/scripts/add-linuxcnc-repository.sh index 37da2cf579e..2130927e1c1 100755 --- a/.github/scripts/add-linuxcnc-repository.sh +++ b/.github/scripts/add-linuxcnc-repository.sh @@ -12,8 +12,8 @@ case $DIST in ;; *) GPGTMP=$(mktemp -d /tmp/.gnupgXXXXXX) - gpg --homedir $GPGTMP --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 - gpg --homedir $GPGTMP --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null + gpg --homedir "$GPGTMP" --keyserver hkp://keyserver.ubuntu.com --recv-key e43b5a8e78cc2927 + gpg --homedir "$GPGTMP" --export 'LinuxCNC Archive Signing Key' | sudo tee /etc/apt/keyrings/linuxcnc.gpg > /dev/null ;; esac sudo apt-get --quiet update diff --git a/.github/scripts/build-rip.sh b/.github/scripts/build-rip.sh index 4d7d0386a1a..17b5cae8485 100755 --- a/.github/scripts/build-rip.sh +++ b/.github/scripts/build-rip.sh @@ -7,5 +7,5 @@ set -x cd src ./autogen.sh -./configure $@ --disable-check-runtime-deps --enable-werror +./configure "$@" --disable-check-runtime-deps --enable-werror make -O -j$((1+$(nproc))) default pycheck V=1 diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh index 69a590c55b5..7a9f37329a6 100755 --- a/.github/scripts/install-rtai.sh +++ b/.github/scripts/install-rtai.sh @@ -5,21 +5,22 @@ set -x DIST=$1 -#To install the RTAI deb's from linuxcnc base -#.github/scripts/add-linuxcnc-repository.sh $DIST -#sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 -#----- -#To install the RTAI deb's from NTULINUX git -TMPDIR=$(mktemp -d) -( - cd $TMPDIR - curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb - curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb -) -sudo dpkg -i \ - $TMPDIR/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb \ - $TMPDIR/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb \ - $TMPDIR/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb -rm -rf $TMPDIR -#----- +if false; then + #To install the RTAI deb's from linuxcnc base + .github/scripts/add-linuxcnc-repository.sh "$DIST" + sudo apt-get --yes install linux-headers-5.4.279-rtai-amd64 linux-image-5.4.279-rtai-amd64 rtai-modules-5.4.279 +else + #To install the RTAI deb's from NTULINUX git + TMPDIR=$(mktemp -d) + ( + cd "$TMPDIR" + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb + curl --no-progress-meter -fLO https://github.com/NTULINUX/RTAI/releases/download/v5.3.4/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb + ) + sudo dpkg -i \ + "$TMPDIR/linux-headers-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb" \ + "$TMPDIR/linux-image-5.4.302-rtai-amd64_5.4.302-rtai-amd64-1_amd64.deb" \ + "$TMPDIR/rtai-modules-5.4.302_5.3.4-linuxcnc_amd64.deb" + rm -rf "$TMPDIR" +fi \ No newline at end of file diff --git a/.github/scripts/verify-clean-repo.sh b/.github/scripts/verify-clean-repo.sh index 60197075575..f8bcd7dd2d9 100755 --- a/.github/scripts/verify-clean-repo.sh +++ b/.github/scripts/verify-clean-repo.sh @@ -4,17 +4,17 @@ set -eu #Needed so CI fails when anything is wrong if [ $# -gt 0 ]; then #Arguments are pathspecs for git status, used to exclude files for this test - if [ -n "$(git status -u --porcelain -- $@)" ]; then + if [ -n "$(git status -u --porcelain -- "$@")" ]; then echo "Build produced untracked or modified files:----------------------------------------" - git status -u --porcelain -- $@ + git status -u --porcelain -- "$@" echo "-----------------------------------------------------------------------------------" - echo "Pathspec is: \"$@\", withouth pathspec:--------------------------------------------" + echo "Pathspec is: \"$*\", withouth pathspec:--------------------------------------------" git status -u --porcelain echo "-----------------------------------------------------------------------------------" exit 1 else echo Repo is clean - echo "Pathspec is: \"$@\", withouth pathspec:--------------------------------------------" + echo "Pathspec is: \"$*\", withouth pathspec:--------------------------------------------" git status -u --porcelain echo "-----------------------------------------------------------------------------------" exit 0 From f54c140b970a09b10a78db19d9962d97efbc7b55 Mon Sep 17 00:00:00 2001 From: Hannes Diethelm Date: Wed, 6 May 2026 11:26:41 +0200 Subject: [PATCH 26/26] ci: Fix undetected verify fail --- .github/scripts/verify-clean-repo.sh | 4 ++++ .github/workflows/ci.yml | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/scripts/verify-clean-repo.sh b/.github/scripts/verify-clean-repo.sh index f8bcd7dd2d9..54b23aa9c06 100755 --- a/.github/scripts/verify-clean-repo.sh +++ b/.github/scripts/verify-clean-repo.sh @@ -2,6 +2,10 @@ set -eu #Needed so CI fails when anything is wrong +#To let the script fail if git status has any issues +#If a command in $() fails, the script just continues +git status -u --porcelain -- "$@" > /dev/null + if [ $# -gt 0 ]; then #Arguments are pathspecs for git status, used to exclude files for this test if [ -n "$(git status -u --porcelain -- "$@")" ]; then diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fa6559f485..f96c68d2382 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,13 +193,16 @@ jobs: # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 + - name: Git config + run: | + set -x + git config --global --add safe.directory ${PWD} - name: Build architecture-specific Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot run: | set -x - git config --global --add safe.directory ${PWD} .github/scripts/build-package-arch.sh - name: Verify no untracked or modified files after build run: | @@ -272,13 +275,16 @@ jobs: # "fetch-depth: 0" fetches all of history, this is needed by # our build system to determine the version from tags fetch-depth: 0 + - name: Git config + run: | + set -x + git config --global --add safe.directory ${PWD} - name: Build architecture-independent Debian packages env: DEBEMAIL: emc-developers@lists.sourceforge.net DEBFULLNAME: LinuxCNC Github CI Robot run: | set -x - git config --global --add safe.directory ${PWD} .github/scripts/build-package-indep.sh - name: Verify no untracked or modified files after build run: |