<commit_before># `script` phase: you usually build, test and generate docs in this phase

set -ex

# TODO modify this phase as you see fit
# PROTIP Always pass `--target $TARGET` to cargo commands, this makes cargo output build artifacts
# to target/$TARGET/{debug,release} which can reduce the number of needed conditionals in the
# `before_deploy`/packaging phase

case $TARGET in
  # use an emulator to run the cross compiled binaries
  arm-unknown-linux-gnueabihf)
    # build tests but don't run them
    cargo test --target $TARGET --no-run

    # run tests in emulator
    find target/$TARGET/debug -maxdepth 1 -executable -type f | \
      xargs qemu-arm -L /usr/arm-linux-gnueabihf

    # build the main executable
    cargo build --target $TARGET

    # run the main executable using the emulator
    qemu-arm -L /usr/arm-linux-gnueabihf target/$TARGET/debug/hello
    ;;
  *)
    cargo build --target $TARGET --verbose
    cargo run --target $TARGET
    cargo test --target $TARGET
    ;;
esac

cargo build --target $TARGET --release

# sanity check the file type
file target/$TARGET/release/crowbook<commit_msg>fixed ci/script.sh<commit_after># `script` phase: you usually build, test and generate docs in this phase

set -ex

# TODO modify this phase as you see fit
# PROTIP Always pass `--target $TARGET` to cargo commands, this makes cargo output build artifacts
# to target/$TARGET/{debug,release} which can reduce the number of needed conditionals in the
# `before_deploy`/packaging phase

case $TARGET in
  # use an emulator to run the cross compiled binaries
  arm-unknown-linux-gnueabihf)
    # build tests but don't run them
    cargo test --target $TARGET --no-run

    # run tests in emulator
    find target/$TARGET/debug -maxdepth 1 -executable -type f | \
      xargs qemu-arm -L /usr/arm-linux-gnueabihf

    # build the main executable
    cargo build --target $TARGET

    # run the main executable using the emulator
#    qemu-arm -L /usr/arm-linux-gnueabihf target/$TARGET/debug/crowbook
    ;;
  *)
    cargo build --target $TARGET --verbose
    cargo run --target $TARGET
    cargo test --target $TARGET
    ;;
esac

cargo build --target $TARGET --release

# sanity check the file type
file target/$TARGET/release/crowbook
{'fraction_non_alphanumeric': 0.08913525498891353, 'fraction_numerical': 0.0008869179600886918, 'mean_word_length': 3.101818181818182, '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': '1397337', 'n_tokens_mistral': 683, 'n_tokens_neox': 661, 'n_words': 270}