From c22cff01e850093385a3585e77ff233ad4229bda Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 17 Feb 2022 09:26:10 -0800 Subject: [PATCH] Restored Bazel tests. I accdentally replaced the bazel tests with clang-format tests. --- .github/workflows/bazel_tests.yml | 30 +++++++++++++++++++++++------- .github/workflows/clang_format.yml | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/clang_format.yml diff --git a/.github/workflows/bazel_tests.yml b/.github/workflows/bazel_tests.yml index b6e9fe24dd..062342aeea 100644 --- a/.github/workflows/bazel_tests.yml +++ b/.github/workflows/bazel_tests.yml @@ -1,4 +1,4 @@ -name: Check ClangFormat +name: Bazel Tests on: push: @@ -10,11 +10,27 @@ on: workflow_dispatch: jobs: - check_clang_format: - runs-on: ubuntu-20.04 + + ubuntu: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + include: + - { CC: clang, os: ubuntu-20.04, flags: "" } + - { CC: clang, os: ubuntu-20.04, flags: "-c opt" } # Some warnings only fire with -c opt + - { CC: gcc, os: ubuntu-20.04, flags: "-c opt" } + - { CC: clang, os: ubuntu-20.04, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" } + - { CC: clang, os: ubuntu-20.04, flags: "--config=asan -- -benchmarks:benchmark -python/..." } + - { CC: clang, os: macos-11, flags: "" } + steps: - uses: actions/checkout@v2 - - name: Run ClangFormat - run: find . | grep -E '\.(c|h|cc)$' | grep -E -v '^./(third_party|cmake)' | xargs clang-format -i - - name: Check for differences - run: git diff --exit-code + - name: Setup Python venv + run: rm -rf /tmp/venv && python3 -m venv /tmp/venv + - name: Install dependencies + run: sudo apt install -y ${{ matrix.install }} + if: matrix.install != '' + - name: Run tests + run: cd ${{ github.workspace }} && PATH=/tmp/venv/bin:$PATH CC=${{ matrix.CC }} bazel test --test_output=errors ... ${{ matrix.flags }} diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml new file mode 100644 index 0000000000..b6e9fe24dd --- /dev/null +++ b/.github/workflows/clang_format.yml @@ -0,0 +1,20 @@ +name: Check ClangFormat + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + check_clang_format: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Run ClangFormat + run: find . | grep -E '\.(c|h|cc)$' | grep -E -v '^./(third_party|cmake)' | xargs clang-format -i + - name: Check for differences + run: git diff --exit-code