Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ on:

jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15]

runs-on: ${{ matrix.os }}

env:
BAZEL_USE_CPP_ONLY_TOOLCHAIN: 1

steps:
- uses: actions/checkout@v2
Expand All @@ -17,9 +24,9 @@ jobs:
uses: actions/cache@v1
with:
path: .cache
key: bazel-${{ github.sha }}
key: bazel-${{ matrix.os }}-${{ github.sha }}
restore-keys: |
bazel-
bazel-${{ matrix.os }}

- name: Configure Bazel
run: |
Expand All @@ -30,14 +37,29 @@ jobs:
- name: Install bazelisk
run: |
mkdir -p "${GITHUB_WORKSPACE}/bin"
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-linux-amd64" -o "${GITHUB_WORKSPACE}/bin/bazel"
if [[ ${{ matrix.os }} = macos* ]]; then
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-darwin-amd64" -o "${GITHUB_WORKSPACE}/bin/bazel"
else
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-linux-amd64" -o "${GITHUB_WORKSPACE}/bin/bazel"
fi
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
"${GITHUB_WORKSPACE}/bin/bazel" version

- name: Test
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test //...
"${GITHUB_WORKSPACE}/bin/bazel" test //... \
--execution_log_json_file=test_log_execution.json \
--experimental_workspace_rules_log_file=test_log_workspace.pb

- name: Build
run: |
"${GITHUB_WORKSPACE}/bin/bazel" build //...

- name: Bundle Bazel Logs
run: |
tar czf test_logs_${{ matrix.os }}.tgz test_log_execution.json test_log_workspace.pb

- uses: actions/upload-artifact@v1
with:
name: bazel-logs-${{ matrix.os }}
path: test_logs_${{ matrix.os }}.tgz
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ cc_library(
srcs = glob(["*.c"]),
hdrs = glob(["*.h"]),
copts = ["-w"],
# Work around `ld -rpath` error on MacOS.
linkstatic = 1,
)
""",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
Expand Down