• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Build and Test with Bazel
2permissions:
3  contents: read
4
5on:
6  push:
7    branches:
8      - 'main'
9  pull_request:
10
11jobs:
12  build:
13    timeout-minutes: 120
14    strategy:
15      matrix:
16        os: [ubuntu-latest, windows-2019]
17
18    runs-on: ${{matrix.os}}
19
20    steps:
21      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22        with:
23          fetch-depth: '0'
24      - name: Download dependencies
25        run: python3 utils/git-sync-deps
26      - name: Mount Bazel cache
27        uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
28        with:
29          path: ~/.bazel/cache
30          key: bazel-cache-${{ runner.os }}
31      - name: Build All
32        run: bazel --output_user_root=~/.bazel/cache build //...
33      - name: Test All
34        run: bazel --output_user_root=~/.bazel/cache test //...
35
36  # iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed
37  # The steps are unfortunately duplicated because github actions requires 2 jobs for a dependency
38  build-macos:
39    needs: build
40    timeout-minutes: 120
41    runs-on: macos-latest
42
43    steps:
44      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
45        with:
46          fetch-depth: '0'
47      - name: Download dependencies
48        run: python3 utils/git-sync-deps
49      - name: Mount Bazel cache
50        uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
51        with:
52          path: ~/.bazel/cache
53          key: bazel-cache-${{ runner.os }}
54      - name: Build All
55        run: bazel --output_user_root=~/.bazel/cache build //...
56      - name: Test All
57        run: bazel --output_user_root=~/.bazel/cache test //...
58