-
Notifications
You must be signed in to change notification settings - Fork 51
129 lines (125 loc) · 4.5 KB
/
Copy pathci.yml
File metadata and controls
129 lines (125 loc) · 4.5 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI
on:
pull_request:
branches:
- main
paths:
- "Source/**"
- "Testing/**"
- MODULE.bazel
- BUILD
- helper.bzl
- non_module_deps.bzl
- .github/**
- .bazelrc
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Get clang-format-19
run: sudo apt-get install --no-install-recommends -y clang-format-19
- name: Set clang-format-19 as default
run: |
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-19
clang-format --version
- name: Run linters
run: ./Testing/lint.sh
check_localization:
name: "Check Localization"
runs-on: macos-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Check missing localization strings
run: |
./Testing/localization.py
if [[ -n "$(git diff)" ]]; then
git diff
echo "Base localization has not been updated. Please run:"
echo " ./Testing/localization.py"
echo "and commit any changes it makes."
exit 1 # return an error if localization.py made changes
fi
check-test-suites:
name: "Check Test Suites"
runs-on: macos-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # ratchet:bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
- name: Check all unit tests are in test suites
run: ./Testing/check_test_suites.sh
build-and-test:
name: "Build and Test"
needs: lint
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-15, macos-26]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Auth to GCP
if: ${{ !github.event.pull_request.head.repo.fork }} # This step will only run if it's NOT a fork
continue-on-error: true
id: auth
uses: "google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093" # ratchet:google-github-actions/auth@v3
with:
workload_identity_provider: "projects/131531281042/locations/global/workloadIdentityPools/github/providers/github"
project_id: "santa-build-cache"
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # ratchet:bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ matrix.os }}
repository-cache: true
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # ratchet:maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build
run: |
if [[ "${{ steps.auth.outcome }}" == "success" ]]; then
bazel build \
--verbose_failures \
--sandbox_debug \
--apple_generate_dsym \
--define=SANTA_BUILD_TYPE=adhoc \
--remote_cache=https://storage.googleapis.com/santa-build-cache \
--google_default_credentials \
//Source/gui:Santa
else
bazel build \
--verbose_failures \
--sandbox_debug \
--apple_generate_dsym \
--define=SANTA_BUILD_TYPE=adhoc \
//Source/gui:Santa
fi
- name: Test
run: |
if [[ "${{ steps.auth.outcome }}" == "success" ]]; then
bazel test \
--test_output=errors \
--verbose_failures \
--sandbox_debug \
--define=SANTA_BUILD_TYPE=adhoc \
--remote_cache=https://storage.googleapis.com/santa-build-cache \
--google_default_credentials \
:unit_tests
else
bazel test \
--test_output=errors \
--verbose_failures \
--sandbox_debug \
--define=SANTA_BUILD_TYPE=adhoc \
:unit_tests
fi