Skip to content

fix: cast char to unsigned char in get_uint16 to prevent sign-extension #14269

fix: cast char to unsigned char in get_uint16 to prevent sign-extension

fix: cast char to unsigned char in get_uint16 to prevent sign-extension #14269

Workflow file for this run

# vim: sw=2
name: Build CI
on:
push:
pull_request:
release:
types: [published]
check_suite:
types: [rerequested]
permissions:
contents: read # to fetch code (actions/checkout)
env:
DEBIAN_FRONTEND: noninteractive
jobs:
rip-and-test:
runs-on: ubuntu-24.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
fetch-depth: 1
- name: Install dependencies
run: |
set -x
.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
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v6
with:
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
#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
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v6
with:
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 -q update
sudo apt-get --yes 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
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
fetch-depth: 1
- name: Install dependencies
run: |
set -x
.github/scripts/install-deps.sh
- name: Build HTML docmentation
run: |
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 }}
strategy:
matrix:
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"]
image: ["debian:bookworm", "debian:trixie", "debian:sid"]
container:
image: ${{ matrix.image }}
# IPC_OWNER is needed for shmget IPC_CREAT
# SYS_ADMIN is needed for shmctl IPC_SET
options: --cap-add=IPC_OWNER --cap-add=SYS_ADMIN
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Install pre-dependencies
run: |
set -x
apt-get -q update
apt --yes upgrade
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package and run tests.
apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts sudo adduser xauth
- 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: 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
.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 --yes --no-install-recommends install ../*.deb
- name: Test debian packages
run: |
set -x
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 "./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
ARCH=$(dpkg --print-architecture)
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
(cd "$OUTDIR" && sha256sum * > SHA256SUMS.txt)
echo "DIST=$DIST" >> "$GITHUB_ENV"
echo "ARCH=$ARCH" >> "$GITHUB_ENV"
- name: Compute artifact metadata
id: meta
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:
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:
matrix:
image: ["debian:bookworm", "debian:trixie", "debian:sid"]
container:
image: ${{ matrix.image }}
# IPC_OWNER is needed for shmget IPC_CREAT
# SYS_ADMIN is needed for shmctl IPC_SET
options: --cap-add=IPC_OWNER --cap-add=SYS_ADMIN
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Install pre-dependencies
run: |
set -x
apt-get -q update
apt --yes upgrade
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
apt-get --yes --no-install-recommends install curl git lsb-release python3 devscripts
- 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: 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
.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 -x
apt-get --yes --no-install-recommends install ../*.deb
- name: Gather build artifacts
run: |
set -x
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
(cd "$OUTDIR" && sha256sum * > SHA256SUMS.txt)
echo "DIST=$DIST" >> "$GITHUB_ENV"
echo "ARCH=$ARCH" >> "$GITHUB_ENV"
- name: Compute artifact metadata
id: meta
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:
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
release:
name: Release packages
needs:
- package-arch
- package-indep
if: (github.event_name == 'release' && github.event.action == 'published') || startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: release_artifacts
- name: Prepare upload assets
run: |
set -x
mkdir -p upload
echo "Downloaded artifacts layout:" && find release_artifacts -maxdepth 3 -print | sed 's/^/ /'
for d in release_artifacts/*; do
[ -d "$d" ] || continue
name=$(basename "$d")
# Expect name like linuxcnc-bookworm-amd64 or linuxcnc-trixie-all
dist=${name#linuxcnc-}
dist=${dist%-*}
arch=${name##*-}
echo "Processing artifact: $name (dist=$dist arch=$arch)"
# Copy built files into distro and arch specific directory
mkdir "upload/${dist}-${arch}/"
# sort file list for stable output
for f in $(find "$d" -maxdepth 1 -type f | LC_ALL=C sort); do
[ -f "$f" ] || continue
cp "$f" "upload/${dist}-${arch}"
done
echo "Preview of SHA256SUMS.txt:" && sed -n '1,200p' "upload/${dist}-${arch}/SHA256SUMS.txt" | sed 's/^/ /'
echo "Upload dir contents:" && ls -l "upload/${dist}-${arch}" | sed 's/^/ /'
done
- name: Create GitHub Release and upload assets
uses: softprops/action-gh-release@v3
with:
files: |
upload/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}