This repository was archived by the owner on Apr 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (70 loc) · 2.12 KB
/
ci.yaml
File metadata and controls
78 lines (70 loc) · 2.12 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
73
74
75
76
77
78
name: CI
on:
push:
branches:
- main
merge_group:
pull_request:
types:
- opened
- synchronize
env:
BAZEL_STARTUP_FLAGS: --bazelrc=${{ github.workspace }}/.github/github.bazelrc
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
- os: ubuntu-24.04
- os: ubuntu-24.04-arm
# - os: windows-2022
steps:
# Checkout the code
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Setup Bazelrc (Windows)
run: |
echo "TEMP=$env:RUNNER_TEMP" >> "$env:GITHUB_ENV"
echo "TMP=$env:RUNNER_TEMP" >> "$env:GITHUB_ENV"
echo "startup --output_user_root=D:/bzl" > ./user.bazelrc
if: startswith(runner.os, 'Windows')
- name: Setup Bazelrc
run: |
echo "common --keep_going" >> ./user.bazelrc
# Build and Test the code
- name: Test (Unix)
run: bazel ${BAZEL_STARTUP_FLAGS[@]} test //...
if: startswith(runner.os, 'Windows') != true
- name: Test (Windows)
run: bazel $env:BAZEL_STARTUP_FLAGS test //...
if: startswith(runner.os, 'Windows')
ci-format:
runs-on: ubuntu-24.04
steps:
# Checkout the code
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- uses: DoozyX/clang-format-lint-action@v0.14
with:
source: "."
extensions: "h,c,cc"
clangFormatVersion: 14
- name: Buildifier
run: |
wget "https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-linux-amd64" -O buildifier
chmod +x ./buildifier
./buildifier -lint=warn -mode=check -warnings=all -r ${{ github.workspace }}
rm ./buildifier
env:
BUILDIFIER_VERSION: 8.2.0