Replaces expect in windows test action #94
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: Test Windows | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Set fail-fast to false to ensure that feedback is delivered for all | |
# matrix combinations. Consider changing this to true when your workflow | |
# is stable. | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
build_type: [Debug, Release] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-activate-base: false | |
environment-file: environment.yml | |
activate-environment: ll-cpp | |
miniforge-version: latest | |
use-mamba: true | |
channels: conda-forge | |
- name: Install RapidCheck | |
shell: bash -el {0} | |
env: | |
RAPIDCHECK_GIT_SHA: ff6af6fc683159deb51c543b065eba14dfcf329b | |
run: | | |
git clone --single-branch --branch master https://github.com/emil-e/rapidcheck.git ~/rapidcheck | |
pushd ~/rapidcheck | |
git checkout $RAPIDCHECK_GIT_SHA | |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DRC_ENABLE_GTEST=ON | |
cmake --build build --config ${{ matrix.build_type }} | |
cmake --install build --config ${{ matrix.build_type }} | |
popd | |
- name: Configure liblevenshtein-cpp | |
shell: bash -el {0} | |
# FIXME: GTest or RapidCheck do not work on Windows | |
# run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_TESTS=ON | |
run: > | |
cmake -B build | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX | |
- name: Build liblevenshtein-cpp | |
shell: bash -el {0} | |
run: cmake --build build --config ${{ matrix.build_type }} | |
# FIXME: GTest or RapidCheck do not work on Windows | |
# - name: Test liblevenshtein-cpp | |
# shell: bash -el {0} | |
# run: ./build/test/${{ matrix.build_type }}/test-liblevenshtein.exe | |
- name: Install liblevenshtein-cpp | |
shell: bash -el {0} | |
run: cmake --install build --config ${{ matrix.build_type }} | |
- name: Configure liblevenshtein-demo | |
working-directory: example | |
shell: bash -el {0} | |
run: > | |
cmake -B build | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX | |
- name: Build liblevenshtein-demo | |
working-directory: example | |
shell: bash -el {0} | |
run: cmake --build build --config ${{ matrix.build_type }} | |
- name: Run liblevenshtein-demo | |
working-directory: example | |
shell: bash -el {0} | |
run: > | |
echo 'Jvaa\nClojre\nPtyhon\n\n' | | |
./build/${{ matrix.build_type }}/liblevenshtein-demo.exe | |
--dictionary-path resources/programming-languages.txt | |
--serialization-path build/programming-languages.pb |