From 445bbde6823242396983468991108b585fe6a59e Mon Sep 17 00:00:00 2001 From: Christian Edward Gruber Date: Tue, 16 Jun 2020 10:55:04 -0700 Subject: [PATCH 1/4] Create github CI action --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 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 00000000..8064152e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +# 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.4.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 }}" + - 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.4.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 }}" + - name: Build All + run: | + "${GITHUB_WORKSPACE}/bin/bazel" build //... + - name: Test All + run: | + "${GITHUB_WORKSPACE}/bin/bazel" test //... + From d14e93d2476eed0f414b53ececb652d5b66013b1 Mon Sep 17 00:00:00 2001 From: Christian Edward Gruber Date: Tue, 16 Jun 2020 11:03:03 -0700 Subject: [PATCH 2/4] Update bazelisk on ci, and log the bazel version --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8064152e..33c9622a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,12 @@ jobs: key: caches-${{ runner.os }} - name: Install bazelisk run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-darwin-amd64" + 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 //... @@ -59,11 +60,12 @@ jobs: key: caches-${{ runner.os }} - name: Install bazelisk run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.4.0/bazelisk-linux-amd64" + 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 //... From e78d7b5f751550ff7e7d3a8c6e66a4049938a3a6 Mon Sep 17 00:00:00 2001 From: Christian Edward Gruber Date: Tue, 16 Jun 2020 11:05:27 -0700 Subject: [PATCH 3/4] Force bazel to 0.22, to account for present state of repo rules. --- .bazelversion | 1 + 1 file changed, 1 insertion(+) create mode 100644 .bazelversion diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000..e3462940 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +0.22 From 74f6b613aeb51a5c263c628294e54eda5f9df6b2 Mon Sep 17 00:00:00 2001 From: Christian Edward Gruber Date: Tue, 16 Jun 2020 11:07:43 -0700 Subject: [PATCH 4/4] add patch version string. --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index e3462940..21574090 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -0.22 +0.22.0