From 050a8cee312684bedbff5e031cb1d73938452ec2 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 24 May 2024 11:22:15 +0200 Subject: [PATCH] Add CI checks --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ examples/.bazelrc | 1 + 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7feb300 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: Test examples + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * *' + + workflow_dispatch: + +jobs: + + test_externally: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + bazel: [7.x, last_green] + os: [ubuntu-latest, macos-13, macos-latest] + env: + BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - name: Test examples + env: + USE_BAZEL_VERSION: ${{ matrix.bazel }} + working-directory: ./examples + run: bazelisk test //... + + - name: Upload test logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: testlogs-${{ matrix.bazel}}-${{ matrix.os }} + # https://github.com/actions/upload-artifact/issues/92#issuecomment-711107236 + path: | + ${{ github.workspace }}/examples/bazel-testlogs*/**/test.log diff --git a/examples/.bazelrc b/examples/.bazelrc index 4e0c85e..5a33bd6 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -1,4 +1,5 @@ common --tool_java_runtime_version=remotejdk_17 +common --test_output=errors # These settings make it harder for bazel_env to do its job and are here to # verify it still works.