infra: Add pull request presubmit checks, continuous main
checks
#5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Presubmit checks for PRs | |
name: "presubmit" | |
on: | |
# Trigger on pull request rather than push, so that we can control whether | |
# checks are run on a given PR (allowing checks to run automatically on PR | |
# updates from third parties can be a security issue). | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}.${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
bazel-builder: | |
# TODO(scott): Move to CI runners | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazelbuild/setup-bazelisk@v3 | |
- name: restore bazel cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: "~/.cache/bazel" | |
key: ${{ runner.os }}-bazel-${{ github.ref }} | |
restore-keys: | | |
${{ runner.os }}-bazel- | |
- name: run all tests | |
run: | | |
bazel test --config=presubmit //... | |
- name: save bazel cache | |
uses: actions/cache/save@v4 | |
with: | |
path: "~/.cache/bazel" | |
key: ${{ runner.os }}-bazel-${{ github.ref }} | |
golang-builder: | |
# TODO(scott): Move to CI runners | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: build all | |
run: | | |
go build ./... | |
- name: run all tests | |
run: | | |
go test ./... |