|
| 1 | +name: CMake |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + BUILD_TYPE: Release |
| 7 | + |
| 8 | +jobs: |
| 9 | + build_linux_clang: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + BUILD_TYPE: [Release, Debug] |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Configure CMake |
| 20 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DRAPIDFUZZ_BUILD_TESTING=1 -DRAPIDFUZZ_ENABLE_LINTERS=1 -DRAPIDFUZZ_BUILD_FUZZERS=1 -DCMAKE_CXX_COMPILER=clang++ |
| 21 | + |
| 22 | + - name: Build |
| 23 | + run: cmake --build build --config ${{matrix.BUILD_TYPE}} |
| 24 | + |
| 25 | + - name: Test |
| 26 | + working-directory: build |
| 27 | + run: ctest -C ${{matrix.BUILD_TYPE}} --rerun-failed --output-on-failure |
| 28 | + |
| 29 | + - name: Fuzz Test |
| 30 | + working-directory: build |
| 31 | + run: | |
| 32 | + fuzzing/fuzz_lcs_similarity -max_total_time=30 |
| 33 | + fuzzing/fuzz_levenshtein_distance -max_total_time=30 |
| 34 | + fuzzing/fuzz_levenshtein_editops -max_total_time=30 |
| 35 | + fuzzing/fuzz_indel_distance -max_total_time=30 |
| 36 | + fuzzing/fuzz_indel_editops -max_total_time=30 |
| 37 | + fuzzing/fuzz_osa_distance -max_total_time=30 |
| 38 | + fuzzing/fuzz_damerau_levenshtein_distance -max_total_time=30 |
| 39 | + |
| 40 | + build_linux_clang_32: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + BUILD_TYPE: [Release, Debug] |
| 46 | + env: |
| 47 | + CXXFLAGS: -m32 |
| 48 | + CFLAGS: -m32 |
| 49 | + |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v2 |
| 52 | + |
| 53 | + - name: Install Dependencies |
| 54 | + run: | |
| 55 | + sudo apt update |
| 56 | + sudo apt install -y libc6-dev-i386 g++-multilib |
| 57 | + |
| 58 | + - name: Configure CMake |
| 59 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DRAPIDFUZZ_BUILD_TESTING=1 -DRAPIDFUZZ_ENABLE_LINTERS=1 -DRAPIDFUZZ_BUILD_FUZZERS=1 -DCMAKE_CXX_COMPILER=clang++ |
| 60 | + |
| 61 | + - name: Build |
| 62 | + run: cmake --build build --config ${{matrix.BUILD_TYPE}} |
| 63 | + |
| 64 | + - name: Test |
| 65 | + working-directory: build |
| 66 | + run: ctest -C ${{matrix.BUILD_TYPE}} --rerun-failed --output-on-failure |
| 67 | + |
| 68 | + - name: Fuzz Test |
| 69 | + working-directory: build |
| 70 | + run: | |
| 71 | + fuzzing/fuzz_lcs_similarity -max_total_time=30 |
| 72 | + fuzzing/fuzz_levenshtein_distance -max_total_time=30 |
| 73 | + fuzzing/fuzz_levenshtein_editops -max_total_time=30 |
| 74 | + fuzzing/fuzz_indel_distance -max_total_time=30 |
| 75 | + fuzzing/fuzz_indel_editops -max_total_time=30 |
| 76 | + fuzzing/fuzz_osa_distance -max_total_time=30 |
| 77 | + fuzzing/fuzz_damerau_levenshtein_distance -max_total_time=30 |
| 78 | + |
| 79 | + build_linux_gcc: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + strategy: |
| 82 | + fail-fast: false |
| 83 | + matrix: |
| 84 | + BUILD_TYPE: [Release, Debug] |
| 85 | + |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v2 |
| 88 | + |
| 89 | + - name: Configure CMake |
| 90 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DRAPIDFUZZ_BUILD_TESTING=1 -DRAPIDFUZZ_ENABLE_LINTERS=1 -DCMAKE_CXX_COMPILER=g++ |
| 91 | + |
| 92 | + - name: Build |
| 93 | + run: cmake --build build --config ${{matrix.BUILD_TYPE}} |
| 94 | + |
| 95 | + - name: Test |
| 96 | + working-directory: build |
| 97 | + run: ctest -C ${{matrix.BUILD_TYPE}} --rerun-failed --output-on-failure |
| 98 | + |
| 99 | + build_windows: |
| 100 | + runs-on: windows-latest |
| 101 | + strategy: |
| 102 | + fail-fast: false |
| 103 | + matrix: |
| 104 | + BUILD_TYPE: [Release, Debug] |
| 105 | + |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v2 |
| 108 | + |
| 109 | + - name: Configure CMake |
| 110 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DRAPIDFUZZ_BUILD_TESTING=1 -DRAPIDFUZZ_ENABLE_LINTERS=1 |
| 111 | + |
| 112 | + - name: Build |
| 113 | + run: cmake --build build --config ${{matrix.BUILD_TYPE}} |
| 114 | + |
| 115 | + - name: Test |
| 116 | + working-directory: build |
| 117 | + run: ctest -C ${{matrix.BUILD_TYPE}} --rerun-failed --output-on-failure |
| 118 | + |
| 119 | + build_cmake_installed: |
| 120 | + runs-on: ubuntu-latest |
| 121 | + |
| 122 | + steps: |
| 123 | + - uses: actions/checkout@v2 |
| 124 | + |
| 125 | + - name: Configure CMake |
| 126 | + run: cmake -B build -DCMAKE_BUILD_TYPE=Release |
| 127 | + |
| 128 | + - name: Install RapidFuzz |
| 129 | + run: sudo cmake --build build --target install |
| 130 | + |
| 131 | + - name: Configure example project |
| 132 | + working-directory: examples/cmake_installed |
| 133 | + run: cmake -B build -DCMAKE_BUILD_TYPE=Release |
| 134 | + |
| 135 | + - name: Build example project |
| 136 | + working-directory: examples/cmake_installed |
| 137 | + run: cmake --build build --config ${{env.BUILD_TYPE}} |
| 138 | + |
| 139 | + - name: Run example project |
| 140 | + working-directory: examples/cmake_installed/build |
| 141 | + run: ./foo |
| 142 | + |
| 143 | + build_cmake_subdir: |
| 144 | + runs-on: ubuntu-latest |
| 145 | + strategy: |
| 146 | + fail-fast: false |
| 147 | + matrix: |
| 148 | + BUILD_TYPE: [Release, Debug] |
| 149 | + |
| 150 | + steps: |
| 151 | + - uses: actions/checkout@v2 |
| 152 | + |
| 153 | + - name: Configure the library dependent on RapidFuzz |
| 154 | + working-directory: examples/cmake_export |
| 155 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} |
| 156 | + |
| 157 | + - name: Build the library dependent on RapidFuzz |
| 158 | + working-directory: examples/cmake_export |
| 159 | + run: cmake --build build --config ${{matrix.BUILD_TYPE}} |
| 160 | + |
| 161 | + - name: Install the library dependent on RapidFuzz |
| 162 | + working-directory: examples/cmake_export |
| 163 | + run: sudo cmake --build build --target install |
| 164 | + |
| 165 | + - name: Configure the app indirectly dependent on RapidFuzz |
| 166 | + working-directory: examples/cmake_export/indirect_app |
| 167 | + run: cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} |
| 168 | + |
| 169 | + - name: Build the app indirectly dependent on RapidFuzz |
| 170 | + working-directory: examples/cmake_export/indirect_app |
| 171 | + run: cmake --build build --config ${{matrix.BUILD_TYPE}} |
| 172 | + |
| 173 | + - name: Run the app indirectly dependent on RapidFuzz |
| 174 | + working-directory: examples/cmake_export/indirect_app/build |
| 175 | + run: ./fooapp |
| 176 | + |
| 177 | + build_cpack_installed: |
| 178 | + runs-on: ubuntu-latest |
| 179 | + |
| 180 | + steps: |
| 181 | + - uses: actions/checkout@v2 |
| 182 | + |
| 183 | + - name: Configure CMake |
| 184 | + run: cmake -B build -DCMAKE_BUILD_TYPE=Release |
| 185 | + |
| 186 | + - name: Install RapidFuzz |
| 187 | + working-directory: build |
| 188 | + run: | |
| 189 | + cpack -G DEB |
| 190 | + sudo dpkg -i *.deb |
| 191 | + |
| 192 | + - name: Configure example project |
| 193 | + working-directory: examples/cmake_installed |
| 194 | + run: cmake -B build -DCMAKE_BUILD_TYPE=Release |
| 195 | + |
| 196 | + - name: Build example project |
| 197 | + working-directory: examples/cmake_installed |
| 198 | + run: cmake --build build --config ${{env.BUILD_TYPE}} |
| 199 | + |
| 200 | + - name: Run example project |
| 201 | + working-directory: examples/cmake_installed/build |
| 202 | + run: ./foo |
0 commit comments