Fix: python slices of splits used incorrect offsets. #177
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pre-Release | |
on: | |
push: | |
branches: ["main-dev"] | |
pull_request: | |
branches: ["main-dev"] | |
env: | |
BUILD_TYPE: Release | |
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} | |
PYTHONUTF8: 1 | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
jobs: | |
test_ubuntu_gcc: | |
name: Ubuntu (GCC 12) | |
runs-on: ubuntu-22.04 | |
env: | |
CC: gcc-12 | |
CXX: g++-12 | |
steps: | |
- uses: actions/checkout@v3 | |
# C/C++ | |
# If the compilation fails, we want to log the compilation commands in addition to | |
# the standard output. | |
- name: Build C/C++ | |
run: | | |
sudo apt update | |
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12 | |
cmake -B build_artifacts \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ | |
-DSTRINGZILLA_BUILD_BENCHMARK=1 \ | |
-DSTRINGZILLA_BUILD_TEST=1 | |
cmake --build build_artifacts --config RelWithDebInfo > build_artifacts/logs.txt 2>&1 || { | |
echo "Compilation failed. Here are the logs:" | |
cat build_artifacts/logs.txt | |
echo "The original compilation commands:" | |
cat build_artifacts/compile_commands.json | |
echo "CPU Features:" | |
lscpu | |
echo "GCC Version:" | |
gcc-12 --version | |
echo "G++ Version:" | |
g++-12 --version | |
exit 1 | |
} | |
- name: Test C++ | |
run: ./build_artifacts/stringzilla_test_cpp20 | |
- name: Test on Real World Data | |
run: | | |
./build_artifacts/stringzilla_bench_search ${DATASET_PATH} # for substring search | |
./build_artifacts/stringzilla_bench_token ${DATASET_PATH} # for hashing, equality comparisons, etc. | |
./build_artifacts/stringzilla_bench_similarity ${DATASET_PATH} # for edit distances and alignment scores | |
./build_artifacts/stringzilla_bench_sort ${DATASET_PATH} # for sorting arrays of strings | |
./build_artifacts/stringzilla_bench_container ${DATASET_PATH} # for STL containers with string keys | |
env: | |
DATASET_PATH: ./README.md | |
# Don't overload GitHub with our benchmarks. | |
# The results in such an unstable environment will be meaningless anyway. | |
if: 0 | |
# Python | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Build Python | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest pytest-repeat numpy | |
python -m pip install . | |
- name: Test Python | |
run: pytest scripts/test.py -s -x | |
# JavaScript | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Build and test JavaScript | |
run: npm ci && npm test |