diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a59c8be..7a939ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: | @@ -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 diff --git a/WORKSPACE b/WORKSPACE index c446fec..6ac2506 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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",