Merge pull request #46 from mahmudhera/main #18
This file contains hidden or 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: CI Pipeline | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout the code | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# 2. Install build tools | |
- name: Install build tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential g++ | |
# 3. Build the C++ binaries | |
- name: Build C++ project | |
run: make | |
# 4. Generate file list for input files | |
- name: Generate file list for input | |
run: | | |
echo "Generating file list..." | |
find test/data/sketches_100 -type f > test/data/filelist_100.txt | |
find test/data/sketches_50 -type f > test/data/filelist_50.txt | |
# 5. Run the binaries using generated file list | |
- name: Run binaries on generated file list | |
run: | | |
mkdir -p test/output | |
mkdir -p test/output/working_directory | |
./bin/index test/data/filelist_100.txt test/output/index_100 -t 4 -n 1000 | |
./bin/index test/data/filelist_50.txt test/output/index_50 -t 4 -n 1000 | |
./bin/compare test/data/filelist_100.txt test/output/index_100/ test/output/working_directory test/output/compare_100_v_100 -c 0.0 -t 2 -n 500 -k 51 | |
./bin/compare test/data/filelist_50.txt test/output/index_100/ test/output/working_directory test/output/compare_50_v_100 -c 0.0 -t 2 -n 500 -k 51 | |
./bin/compare test/data/filelist_100.txt test/output/index_50/ test/output/working_directory test/output/compare_100_v_50 -c 0.0 -t 2 -n 500 -k 51 | |
./bin/compare test/data/filelist_50.txt test/output/index_50/ test/output/working_directory test/output/compare_50_v_50 -c 0.0 -t 2 -n 500 -k 51 | |
echo "Binaries executed successfully." | |
# 6. Set up Python environment | |
- name: Set up Python environment | |
uses: actions/setup-python@v5 | |
- name: Install Python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r test/requirements.txt | |
# 7. Run Python tests for correctness | |
- name: Run Python correctness tests | |
run: | | |
python test/test_correctness_of_index.py --filelist test/data/filelist_100.txt --index_directory test/output/index_100 | |
python test/test_correctness_of_index.py --filelist test/data/filelist_50.txt --index_directory test/output/index_50 | |
python test/compare_multisearch_results.py test/data/multisearch_100_v_100 test/output/compare_100_v_100 | |
python test/compare_multisearch_results.py test/data/multisearch_50_v_100 test/output/compare_50_v_100 | |
python test/compare_multisearch_results.py test/data/multisearch_100_v_50 test/output/compare_100_v_50 | |
python test/compare_multisearch_results.py test/data/multisearch_50_v_50 test/output/compare_50_v_50 | |
# 8. Test correctness of tar.gz index | |
- name: Test correctness of tar.gz index | |
run: | | |
./bin/index test/data/filelist_100.txt test/output/archived_index_100 -t 4 -n 1000 -s | |
rm -r test/output/archived_index_100 | |
bin/compare test/data/filelist_100.txt test/output/archived_index_100.tar.gz test/output/working_directory test/output/compare_100_v_100_tar -c 0.0 -t 2 -n 500 -k 51 | |
python test/compare_multisearch_results.py test/data/multisearch_100_v_100 test/output/compare_100_v_100_tar | |
# 9. Test correctness of tar.gz index when it has been moved | |
- name: Test correctness of tar.gz index when it has been moved | |
run: | | |
mv test/output/archived_index_100.tar.gz test/data/archived_index_100.tar.gz | |
bin/compare test/data/filelist_100.txt test/data/archived_index_100.tar.gz test/output/working_directory test/output/compare_100_v_100_tar_moved -c 0.0 -t 2 -n 500 -k 51 | |
python test/compare_multisearch_results.py test/data/multisearch_100_v_100 test/output/compare_100_v_100_tar_moved | |
# 10. Run prefetch and compare against sourmash prefetch | |
- name: Run prefetch and compare against sourmash prefetch (threshold=0) | |
run: | | |
./bin/prefetch test/data/query_sketch.sig test/output/index_100 test/output/this_prefetch_against_100 -b 0 | |
./bin/prefetch test/data/query_sketch.sig test/output/index_50 test/output/this_prefetch_against_50 -b 0 | |
python test/compare_against_prefetch.py test/data/sourmash_prefetch_against_100 test/output/this_prefetch_against_100 | |
python test/compare_against_prefetch.py test/data/sourmash_prefetch_against_50 test/output/this_prefetch_against_50 | |
# 11. Run prefetch and compare against sourmash prefetch | |
- name: Run prefetch and compare against sourmash prefetch (threshold=2) | |
run: | | |
./bin/prefetch test/data/query_sketch.sig test/output/index_100 test/output/this_prefetch_against_100_threshold_2 -b 2 | |
./bin/prefetch test/data/query_sketch.sig test/output/index_50 test/output/this_prefetch_against_50_threshold_2 -b 2 | |
python test/compare_against_prefetch.py test/data/sourmash_prefetch_against_100_threshold_2 test/output/this_prefetch_against_100_threshold_2 | |
python test/compare_against_prefetch.py test/data/sourmash_prefetch_against_50_threshold_2 test/output/this_prefetch_against_50_threshold_2 |