forked from modular/modular
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.33 KB
/
build_and_test.yml
File metadata and controls
72 lines (63 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##===----------------------------------------------------------------------===##
# Copyright (c) 2025, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##===----------------------------------------------------------------------===##
name: Build and Test
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
push:
branches:
- main
paths:
- "bazel/mojo.MODULE.bazel"
permissions:
contents: read
pull-requests: read
concurrency: # Only allow a single build/test run at a time for a PR.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-and-test:
name: Build and Test on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["large-oss-linux", "macos-15"]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build and Test
run: |
if [[ -n "${BUILDBUDDY_TOKEN:-}" ]]; then
# NOTE: Read+write token that only runs on trusted PRs.
args=(
--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_TOKEN
)
else
# NOTE: Readonly token that we're ok with being here.
args=(
--remote_header=x-buildbuddy-api-key=gJPttl2LQEONgD2aKziQ
--remote_upload_local_results=false
)
fi
# NOTE: Skip the buildbuddy sidecar on linux where the machine is too small.
# TODO: Remove this once upstream has fixed the issue.
BB_DISABLE_SIDECAR=1 ./bazelw test --config=ci --config=public-cache "${args[@]}" --build_tag_filters=-skip-external-ci-${{ matrix.os }},-requires-network --test_tag_filters=-skip-external-ci-${{ matrix.os }},-requires-network -- //...
env:
BUILDBUDDY_TOKEN: ${{ secrets.BUILDBUDDY_TOKEN }}