Skip to content

Commit

Permalink
Merge pull request #1 from cgruber/cgruber-patch-1
Browse files Browse the repository at this point in the history
Create github CI action
  • Loading branch information
cgruber authored Jun 16, 2020
2 parents 665fc03 + 74f6b61 commit e6ad82a
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.22.0
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 //...

0 comments on commit e6ad82a

Please sign in to comment.