forked from livegrep/livegrep
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.04 KB
/
ci.yaml
File metadata and controls
37 lines (35 loc) · 1.04 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
on:
pull_request:
branches:
- main
push:
branches:
- main
name: Continuous integration
jobs:
ci:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: Switch to CI bazelrc
run: cp .bazelrc.ci .bazelrc
- name: Cache Bazel disk cache
uses: actions/cache@v4
with:
path: ~/.cache/bazel-disk
key: bazel-disk-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock') }}-${{ github.sha }}
restore-keys: |
bazel-disk-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock') }}-
bazel-disk-${{ runner.os }}-
- name: bazel build
run: bazel build //...
- name: bazel test
run: bazel test --test_arg=-test.v //...
- name: gofmt
run: |
format_errors=$(bazel run @rules_go//go -- fmt ./...)
if [ "$format_errors" ]; then
echo "=== misformatted files (run gofmt) ==="
echo "$format_errors"
exit 1
fi