Skip to content

Commit

Permalink
infra: WIP for pull request presubmit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
minor-fixes committed Jul 12, 2024
1 parent 0ef853f commit 75b1a87
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ build:macos --workspace_status_command=infra/get_workspace_status

test --test_summary=testcase
test --test_output=errors

# These settings should be enabled whenever bazel is running in an automated
# context
build:noninteractive --color=yes
build:noninteractive --curses=no
build:noninteractive --show_timestamps
build:noninteractive --announce_rc
build:noninteractive --test_output=summary
build:noninteractive --keep_going

build:presubmit --config=noninteractive
build:postsubmit --config=noninteractive
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Postsubmit checks that run on the `main` branch after merge.
name: "main"

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}.${{ github.ref }}

jobs:
bazel-builder:
runs-on:
- self-hosted
- "os=linux"
- "arch=x64"
- "os_distribution=debian"
- "revision=d04e89854b3931f4aaced77aa3a2fcad5834b3a6"
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- name: run all tests
run: |
bazel test --config=postsubmit //...
golang-builder:
runs-on:
- self-hosted
- "os=linux"
- "arch=x64"
- "os_distribution=debian"
- "revision=d04e89854b3931f4aaced77aa3a2fcad5834b3a6"
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- name: build all
run: |
go build ./...
- name: run all tests
run: |
go test ./...
48 changes: 48 additions & 0 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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:
- self-hosted
- "os=linux"
- "arch=x64"
- "os_distribution=debian"
- "revision=d04e89854b3931f4aaced77aa3a2fcad5834b3a6"
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- name: run all tests
run: |
bazel test --config=presubmit //...
golang-builder:
runs-on:
- self-hosted
- "os=linux"
- "arch=x64"
- "os_distribution=debian"
- "revision=d04e89854b3931f4aaced77aa3a2fcad5834b3a6"
timeout-minutes: 5

steps:
- name: checkout
uses: actions/checkout@v4
- name: build all
run: |
go build ./...
- name: run all tests
run: |
go test ./...

0 comments on commit 75b1a87

Please sign in to comment.