diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000..21574090 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +0.22.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..33c9622a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: + - master + - main + - release* + pull_request: + branches: + - master + - main +jobs: + test-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Mount caches + uses: actions/cache@v2 + with: + path: | + "/home/runner/.cache/bazel" + "/home/runner/.m2/repository" + key: caches-${{ runner.os }} + - name: Install bazelisk + run: | + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.5.0/bazelisk-darwin-amd64" + mkdir -p "${GITHUB_WORKSPACE}/bin/" + mv bazelisk-darwin-amd64 "${GITHUB_WORKSPACE}/bin/bazel" + chmod a+x "${GITHUB_WORKSPACE}/bin/bazel" + echo "::set-env name=BAZELISK_GITHUB_TOKEN::${{ secrets.GITHUB_TOKEN }}" + "${GITHUB_WORKSPACE}/bin/bazel" version + - name: Build All + run: | + "${GITHUB_WORKSPACE}/bin/bazel" build //... + - name: Test All + run: | + "${GITHUB_WORKSPACE}/bin/bazel" test //... + + test-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Mount caches + uses: actions/cache@v2 + with: + path: | + "/home/runner/.cache/bazel" + "/home/runner/.m2/repository" + key: caches-${{ runner.os }} + - name: Install bazelisk + run: | + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.5.0/bazelisk-linux-amd64" + mkdir -p "${GITHUB_WORKSPACE}/bin/" + mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" + chmod a+x "${GITHUB_WORKSPACE}/bin/bazel" + echo "::set-env name=BAZELISK_GITHUB_TOKEN::${{ secrets.GITHUB_TOKEN }}" + "${GITHUB_WORKSPACE}/bin/bazel" version + - name: Build All + run: | + "${GITHUB_WORKSPACE}/bin/bazel" build //... + - name: Test All + run: | + "${GITHUB_WORKSPACE}/bin/bazel" test //... +