<commit_before>#!/bin/bash
# Should be run from the root dir, or SOURCE_DIR should be set.
set -o errexit
set -o nounset

: ${SOURCE_DIR:="."}
: ${DIST_DIR:="${SOURCE_DIR}/dist"}
: ${BUILD_DIR:="/tmp/build"}

# Set path to prioritize our utils
export REAL_PATH="${PATH}"
export PATH="$(readlink -f "${SOURCE_DIR}")/ci/util:${PATH}"

# Build
cmake -B"${BUILD_DIR}" -H"${SOURCE_DIR}"

pushd "${BUILD_DIR}"
make clean
make
make package

popd

# Smoke tests (actual tests need Docker to run; they don't run within the CI environment)
tini="${BUILD_DIR}/tini"
echo "Testing $tini with: true"
$tini -vvvv true

echo "Testing $tini with: false"
if $tini -vvvv false; then
  exit 1
fi

# Place files
mkdir -p "${DIST_DIR}"
cp "${BUILD_DIR}"/tini{,*.rpm,*deb} "${DIST_DIR}"

# Quick audit
echo "Contents for RPM:"
rpm -qlp "${DIST_DIR}/tini"*.rpm
echo "Contents for DEB:"
dpkg --contents "${DIST_DIR}/tini"*deb<commit_msg>Don't fail build if logging contents fails<commit_after>#!/bin/bash
# Should be run from the root dir, or SOURCE_DIR should be set.
set -o errexit
set -o nounset

: ${SOURCE_DIR:="."}
: ${DIST_DIR:="${SOURCE_DIR}/dist"}
: ${BUILD_DIR:="/tmp/build"}

# Set path to prioritize our utils
export REAL_PATH="${PATH}"
export PATH="$(readlink -f "${SOURCE_DIR}")/ci/util:${PATH}"

# Build
cmake -B"${BUILD_DIR}" -H"${SOURCE_DIR}"

pushd "${BUILD_DIR}"
make clean
make
make package

popd

# Smoke tests (actual tests need Docker to run; they don't run within the CI environment)
tini="${BUILD_DIR}/tini"
echo "Testing $tini with: true"
$tini -vvvv true

echo "Testing $tini with: false"
if $tini -vvvv false; then
  exit 1
fi

# Place files
mkdir -p "${DIST_DIR}"
cp "${BUILD_DIR}"/tini{,*.rpm,*deb} "${DIST_DIR}"

# Quick audit
if which rpm; then
  echo "Contents for RPM:"
  rpm -qlp "${DIST_DIR}/tini"*.rpm
fi

if which dpkg; then
  echo "Contents for DEB:"
  dpkg --contents "${DIST_DIR}/tini"*deb
fi
{'fraction_non_alphanumeric': 0.17024620220010478, 'fraction_numerical': 0.0010476689366160294, 'mean_word_length': 4.787878787878788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1596164', 'n_tokens_mistral': 740, 'n_tokens_neox': 699, 'n_words': 229}