diff --git a/.github/scripts/add-linuxcnc-repository.sh b/.github/scripts/add-linuxcnc-repository.sh new file mode 100755 index 00000000000..2130927e1c1 --- /dev/null +++ b/.github/scripts/add-linuxcnc-repository.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +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/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..17b5cae8485 --- /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/scripts/install-deps.sh b/.github/scripts/install-deps.sh new file mode 100755 index 00000000000..f60e0864598 --- /dev/null +++ b/.github/scripts/install-deps.sh @@ -0,0 +1,9 @@ +#!/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 . diff --git a/.github/scripts/install-rtai.sh b/.github/scripts/install-rtai.sh new file mode 100755 index 00000000000..7a9f37329a6 --- /dev/null +++ b/.github/scripts/install-rtai.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -eu #Needed so CI fails when anything is wrong +set -x + +DIST=$1 + +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 new file mode 100755 index 00000000000..54b23aa9c06 --- /dev/null +++ b/.github/scripts/verify-clean-repo.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +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 + echo "Build produced untracked or modified files:----------------------------------------" + git status -u --porcelain -- "$@" + echo "-----------------------------------------------------------------------------------" + echo "Pathspec is: \"$*\", withouth pathspec:--------------------------------------------" + git status -u --porcelain + echo "-----------------------------------------------------------------------------------" + exit 1 + else + echo Repo is clean + echo "Pathspec is: \"$*\", withouth pathspec:--------------------------------------------" + git status -u --porcelain + echo "-----------------------------------------------------------------------------------" + exit 0 + fi +else + #No arguments: Test all files + if [ -n "$(git status -u --porcelain)" ]; then + echo "Build produced untracked or modified files:----------------------------------------" + 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 001e9147e4e..f96c68d2382 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: @@ -21,25 +24,32 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + 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/* - - name: Build RIP & test + submodules: false + fetch-depth: 1 + - name: Install dependencies run: | set -x - sudo apt-get --yes -o Acquire::Retries=5 install eatmydata - eatmydata ./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 - cd src - eatmydata ./autogen.sh - eatmydata ./configure --disable-check-runtime-deps --enable-werror - eatmydata make -O -j$((1+$(nproc))) default pycheck V=1 - # Note that the package build covers html docs - eatmydata ../scripts/rip-environment runtests -p + .github/scripts/install-deps.sh + - name: Build RIP GCC + run: | + set -x + .github/scripts/build-rip.sh --with-realtime=uspace + - name: Verify no untracked or modified files after build + run: | + .github/scripts/verify-clean-repo.sh + - name: Test + 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 @@ -47,38 +57,27 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + 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 + .github/scripts/install-rtai.sh trixie + .github/scripts/install-deps.sh - 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) - #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 - #----- - eatmydata ./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 - 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 + #It is save to assume there is only one /usr/realtime-* folder + .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 rip-and-test-clang: runs-on: ubuntu-24.04 @@ -86,26 +85,55 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + 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/* - - name: Clang build RIP & test + submodules: false + fetch-depth: 1 + - name: Install dependencies + run: | + set -x + .github/scripts/install-deps.sh + - name: Build RIP Clang + run: | + set -x + 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 + - name: Test + 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 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: false + fetch-depth: 1 + - name: Install dependencies 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 - sudo apt-get remove -y firefox firefox-locale-* 2>/dev/null || true - sudo eatmydata 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 - # Note that the package build covers html docs - eatmydata ../scripts/rip-environment runtests -p + sudo apt-get -q update + sudo apt-get -y install cppcheck shellcheck + - name: Cppcheck + continue-on-error: true + run: | + set -x + scripts/cppcheck.sh + - name: Shellcheck + continue-on-error: true + run: | + scripts/shellcheck.sh htmldocs: runs-on: ubuntu-24.04 @@ -113,25 +141,26 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + run: | + echo Number of CPUs: $(nproc) + echo "$GITHUB_CONTEXT" + - name: Checkout repository + 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 + .github/scripts/install-deps.sh - 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 - 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 - # Note that the package build covers html docs + set -x + .github/scripts/build-doc.sh + - name: Verify no untracked or modified files after build + run: | + #*.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 }} @@ -143,80 +172,58 @@ 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: --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 run: | - 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 - # 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 - - - uses: actions/checkout@v3 + 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 xauth --no-install-recommends + - 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 + - name: Git config + run: | 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 - 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 - + 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 - DEBIAN_FRONTEND: noninteractive 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 + .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' + - name: Install debian packages + run: | + set -x + apt-get -y install ../*.deb --no-install-recommends - 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 + 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: 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 -e set -x ARCH=$(dpkg --print-architecture) DIST=$(echo ${{ matrix.image }} | cut -d : -f 2) @@ -231,15 +238,13 @@ 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@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 }} if-no-files-found: error - package-indep: runs-on: ubuntu-24.04 strategy: @@ -249,78 +254,51 @@ 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: --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 run: | - 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 -q update # 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 - - - uses: actions/checkout@v3 + apt-get -y install curl git lsb-release python3 devscripts --no-install-recommends + - 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 + - name: Git config + run: | 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 - 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 - + 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 - DEBIAN_FRONTEND: noninteractive 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 - - name: Test install debian packages - env: - DEBIAN_FRONTEND: noninteractive + .github/scripts/build-package-indep.sh + - name: Verify no untracked or modified files after build + run: | + #*.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 -e set -x - eatmydata 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 @@ -332,35 +310,13 @@ 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@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 }} if-no-files-found: error - - cppcheck: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - 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: @@ -372,12 +328,12 @@ 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 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 @@ -399,7 +355,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/*