From fa744bbbe22da24c745d991fd8f6f0401af7acf7 Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Wed, 20 Apr 2022 09:16:56 +0200 Subject: [PATCH] Add bazel builds and test to Github-CI. --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ BUILD.bazel | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0495461..cb7cf31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,3 +39,26 @@ jobs: - name: Test shell: bash run: cd build && ctest --output-on-failure + + bz-build: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Build + shell: bash + run: | + cd "${{ github.workspace }}" + bazel build '//:yaml-cpp' + + - name: Test + shell: bash + run: | + cd "${{ github.workspace }}" + # For some reason 'bazel test //test:test' gets the first / stripped on windows in CI. + # Therefore use this ugly version, which is working on all platforms. + bazel test test + diff --git a/BUILD.bazel b/BUILD.bazel index e0ebfd9..23e847e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,6 +1,6 @@ yaml_cpp_defines = select({ # On Windows, ensure static linking is used. - "@envoy//bazel:windows_x86_64": ["YAML_CPP_STATIC_DEFINE", "YAML_CPP_NO_CONTRIB"], + "@platforms//os:windows": ["YAML_CPP_STATIC_DEFINE", "YAML_CPP_NO_CONTRIB"], "//conditions:default": [], })