Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/scripts/add-linuxcnc-repository.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .github/scripts/build-doc.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .github/scripts/build-package-arch.sh
Original file line number Diff line number Diff line change
@@ -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 --yes build-dep --arch-only .
debuild -us -uc --build=any
11 changes: 11 additions & 0 deletions .github/scripts/build-package-indep.sh
Original file line number Diff line number Diff line change
@@ -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 --yes build-dep --indep-only .
debuild -us -uc --build=source,all
11 changes: 11 additions & 0 deletions .github/scripts/build-rip.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .github/scripts/install-deps.sh
Original file line number Diff line number Diff line change
@@ -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 --yes --no-install-recommends devscripts equivs build-essential lintian clang
debian/configure
sudo apt-get --yes build-dep .
26 changes: 26 additions & 0 deletions .github/scripts/install-rtai.sh
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions .github/scripts/verify-clean-repo.sh
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading