-
Notifications
You must be signed in to change notification settings - Fork 18
129 lines (113 loc) · 3.55 KB
/
ci.yml
File metadata and controls
129 lines (113 loc) · 3.55 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:
workflow_dispatch:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: CI
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
docker-images: true
large-packages: false
swap-storage: false
- name: Install runtime dependencies
run: >-
sudo apt-get update && sudo apt-get install -y
libxcb-cursor0
libxcb-icccm4
libxcb-image0
libxcb-keysyms1
libxcb-render-util0
libxcb-shape0
libxcb-util1
libxcb-xinput0
libxcb-xkb1
libxkbcommon-x11-0
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
external-cache: true
- name: Repository cache
uses: actions/cache@v4
with:
path: ~/.cache/bazel-repo
key: bazel-repo-${{ runner.os }}-${{ github.sha }}
restore-keys: |
bazel-repo-${{ runner.os }}-
save-always: true
- name: Disk cache
uses: actions/cache@v4
with:
path: ~/.cache/bazel-disk
key: bazel-disk-${{ runner.os }}-${{ github.sha }}
restore-keys: |
bazel-disk-${{ runner.os }}-
save-always: true
- name: Configure caches
run: |
echo "common --repository_cache=$HOME/.cache/bazel-repo" >> ~/.bazelrc
echo "common --disk_cache=$HOME/.cache/bazel-disk" >> ~/.bazelrc
# Isolate the one-time Bazel module-graph resolution so the Lint step
# below reflects actual lint work, not first-invocation setup.
- name: Warm up Bazel
run: bazelisk mod graph >/dev/null
# --- Lint ---
- name: Lint
run: |
bazelisk run //:fix_lint
git diff --exit-code
# --- Unit tests ---
- name: Build tests
run: bazelisk build ... --build_tests_only --profile=build.profile
- name: Analyze build
if: always()
run: bazelisk analyze-profile build.profile
- name: Run tests
run: bazelisk test ... --keep_going --build_tests_only --test_output=errors --profile=test.profile
- name: Analyze test
if: always()
run: bazelisk analyze-profile test.profile
# --- Gallery ---
- name: Gallery query
working-directory: gallery
run: bazelisk query //...
- name: Gallery tests
working-directory: gallery
run: bazelisk test ... --keep_going --build_tests_only --test_output=errors --profile=gallery.profile
- name: Analyze gallery
if: always()
working-directory: gallery
run: bazelisk analyze-profile gallery.profile
# --- Submodules ---
- name: "Submodule: chisel test"
working-directory: chisel
run: >-
bazelisk test ... --keep_going --build_tests_only --test_output=errors
--override_module=bazel-orfs=${{ github.workspace }}
--profile=chisel.profile
- name: "Submodule: lec build"
working-directory: lec
run: >-
bazelisk build ... --keep_going --profile=lec.profile