| # Copyright 2020 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| name: Bazel Test |
| |
| on: [push, pull_request] |
| |
| jobs: |
| unit_tests: |
| name: All unit tests |
| runs-on: ubuntu-latest |
| timeout-minutes: 30 |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v2 |
| - name: Install dependencies |
| run: | |
| sudo apt-get update && sudo apt-get install -yq \ |
| clang-10 \ |
| libunwind-dev \ |
| libblocksruntime-dev |
| - name: Run unit tests |
| run: | |
| bazel test --test_tag_filters=-fuzz-test --build_tests_only //... |
| - name: Run Address Sanitizer tests |
| run: | |
| bazel test --test_tag_filters=-fuzz-test --build_tests_only --config=asan //... |
| fuzzer_run_tests: |
| name: Brief fuzz test runs (C++) |
| runs-on: ubuntu-latest |
| timeout-minutes: 30 |
| strategy: |
| matrix: |
| config: ["asan-libfuzzer", "msan-libfuzzer", "asan-honggfuzz"] |
| target: ["//examples:empty_fuzz_test_run", "//examples:re2_fuzz_test_run"] |
| exclude: |
| # MSAN currently fails on the RE2 target. |
| - config: "msan-libfuzzer" |
| target: "//examples:re2_fuzz_test_run" |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v2 |
| - name: Install dependencies |
| run: | |
| sudo apt-get update && sudo apt-get install -yq \ |
| clang-10 \ |
| libunwind-dev \ |
| libblocksruntime-dev |
| - name: Run smoke test |
| run: | |
| bazel run ${{ matrix.target }} --config=${{ matrix.config }} -- --clean --timeout_secs=5 |
| regression_tests: |
| name: Regression tests (C++) |
| runs-on: ubuntu-latest |
| timeout-minutes: 30 |
| strategy: |
| matrix: |
| config: ["asan-replay", "asan-libfuzzer", "asan-honggfuzz"] |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v2 |
| - name: Install dependencies |
| run: | |
| sudo apt-get update && sudo apt-get install -yq \ |
| clang-10 \ |
| libunwind-dev \ |
| libblocksruntime-dev |
| - name: Run regression tests |
| run: | |
| bazel test --verbose_failures --test_output=all \ |
| --build_tag_filters=fuzz-test --config=${{ matrix.config }} \ |
| //examples:all |
| fuzzer_run_tests_java: |
| name: Brief fuzz test runs (Java) |
| runs-on: ubuntu-latest |
| timeout-minutes: 30 |
| strategy: |
| matrix: |
| config: ["jazzer", "asan-jazzer"] |
| target: ["//examples/java:JavaEmptyFuzzTest_run"] |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v2 |
| - name: Install dependencies |
| run: sudo apt-get update && sudo apt-get install -yq clang-10 |
| - name: Run smoke test |
| run: | |
| bazel run ${{ matrix.target }} --config=${{ matrix.config }} -- --clean --timeout_secs=5 |
| regression_tests_java: |
| name: Regression tests (Java) |
| runs-on: ubuntu-latest |
| timeout-minutes: 30 |
| strategy: |
| matrix: |
| config: ["jazzer", "asan-jazzer"] |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@v2 |
| - name: Install dependencies |
| run: sudo apt-get update && sudo apt-get install -yq clang-10 |
| - name: Run regression tests |
| run: | |
| bazel test --verbose_failures --test_output=all \ |
| --build_tag_filters=fuzz-test --config=${{ matrix.config }} \ |
| //examples/java/... |