Skip to content

Commit

Permalink
abstract the binary name into a test script
Browse files Browse the repository at this point in the history
  • Loading branch information
satreix committed Jul 30, 2023
1 parent b19e3dd commit d30baf7
Showing 2 changed files with 27 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -41,9 +41,4 @@ jobs:
run: cp tools/ci/bazel.rc $HOME/.bazelrc

- name: Test
run: bazel.exe test --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} //...
if: ${{ matrix.os == 'windows-latest' }}

- name: Test
run: bazel test --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} //...
if: ${{ matrix.os != 'windows-latest' }}
run: ./tools/ci/test.sh
26 changes: 26 additions & 0 deletions tools/ci/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -eufo pipefail

if [ $# -lt 1 ]; then
echo "Usage: $0 BUILDBUDDY_API_KEY" >&2
exit 1
fi

buildbuddy_api_key="$1"


echo "uname: $(uname)" >&2
echo "OSTYPE: $OSTYPE" >&2

extra_flags=""
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
BAZEL="bazel.exe"
extra_flags="-k"
else
BAZEL="bazel"
fi

echo "BAZEL: $BAZEL" >&2
echo "extra_flags: $extra_flags" >&2

"$BAZEL" test --remote_header="x-buildbuddy-api-key=$buildbuddy_api_key" $extra_flags //...

0 comments on commit d30baf7

Please sign in to comment.