Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create github CI action #1

Merged
merged 4 commits into from
Jun 16, 2020
Merged
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
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 //...