-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (81 loc) · 2.74 KB
/
main.yml
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
name: "build and test"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
# Cancel previous actions from the same PR or branch except 'main' branch.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# disable repository cache between workflows.
repository-cache: false
# enable some flags for CI
bazelrc: |
import %workspace%/.aspect/bazelrc/ci.bazelrc
# disable cache for MODULE.bazel repos
external-cache: false
- run: bazelisk build //... && bazelisk test //...
e2e-workspace-matrix:
strategy:
matrix:
version: [6.x, 7.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# disable repository cache between workflows.
repository-cache: false
# disable cache for MODULE.bazel repos
external-cache: false
# enable some flags for CI
bazelrc: import %workspace%/../../.aspect/bazelrc/ci.bazelrc
- run: |
set -ex
cd e2e/non-bzlmod
export USE_BAZEL_VERSION=${{ matrix.version.version }}
bazelisk build //...
bazel test //...
e2e-bzlmod-matrix:
strategy:
matrix:
version: [6.x, 7.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# disable repository cache between workflows.
repository-cache: false
# disable cache for MODULE.bazel repos
external-cache: false
# enable some flags for CI
bazelrc: |
import %workspace%/../../.aspect/bazelrc/ci.bazelrc
- run: |
set -ex
cd e2e/bzlmod
export USE_BAZEL_VERSION=${{ matrix.version.version }}
bazelisk build //...
bazel test //...