update cpp standard + new way of linking with find_package #170
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: CMake | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
build: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies (distribution provided) | |
run: sudo apt-get update && sudo apt install libicu-dev libboost-all-dev | |
- name: Install dependencies (google-test tricky install) # See https://stackoverflow.com/questions/24295876/cmake-cannot-find-googletest-required-library-in-ubuntu | |
run: sudo apt install libgtest-dev build-essential cmake && cd /usr/src/googletest && sudo cmake . && sudo cmake --build . --target install | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Install dependencies (OpenNMT Tokenizer) | |
working-directory: ${{runner.workspace}}/build | |
run: git clone --recursive --branch v1.20.0 --depth 1 https://github.com/OpenNMT/Tokenizer && cd Tokenizer && git submodule update --init && mkdir build && cd build && cmake -DLIB_ONLY=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} .. && sudo make install | |
- name: Configure CMake | |
shell: bash | |
run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} | |
- name: Build | |
shell: bash | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: cmake --build . --config ${{ matrix.build }} | |
- name: Building test indexes | |
shell: bash | |
run: | | |
./cli/src/FuzzyMatch-cli -c test/data/tm1,test/data/tm1 --add-target 1 | |
./cli/src/FuzzyMatch-cli -c test/data/tm2.en.gz,test/data/tm2.fr.gz --add-target | |
- name: Test | |
shell: bash | |
run: ./test/FuzzyMatch-test test/data/ |