-
Notifications
You must be signed in to change notification settings - Fork 45
75 lines (66 loc) · 2.33 KB
/
ci.yaml
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
---
name: ci
on:
push:
pull_request:
defaults:
run:
shell: bash
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true
jobs:
build-and-test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/cache@v4
name: "Windows: cache bazelisk and zig-cache"
if: runner.os == 'Windows'
with:
key: cache-${{ matrix.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }}
path: |
C:\Temp\zig-cache
~\AppData\Local\bazelisk'
- uses: actions/cache@v4
name: "MacOS: cache bazelisk and zig-cache"
if: runner.os == 'macOS'
with:
key: cache-${{ matrix.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }}
path: |
/var/tmp/zig-cache
~/Library/Caches/bazelisk
- uses: actions/cache@v4
name: "Linux: cache bazelisk and zig-cache"
if: runner.os == 'Linux'
with:
key: cache-${{ matrix.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }}
path: |
/tmp/zig-cache
~/.cache/bazelisk
- run: echo "common --announce_rc" >> .bazelrc.ci
- run: brew install bash
if: runner.os == 'macOS'
# Linux, macOS and Windows
- run: ci/list_toolchains_platforms
- run: tools/bazel test //...
- run: ci/prepare_git && ci/test_example rules_cc override_repository
- run: ci/prepare_git && ci/test_example bzlmod override_module
- run: ci/zig-utils
# Test the Zig toolchain for Darwin on Darwin.
- run: tools/bazel test --config=macos_toolchains --@rules_go//go/config:static --@rules_go//go/config:pure //test/c/...
if: runner.os == 'macOS'
# Windows problems:
# protoc does not compile due to `-lpthread`.
- run: ci/lint
if: runner.os != 'Windows'
# Releaser emits different hashes
- run: ci/release
if: runner.os != 'Windows'