aboutsummaryrefslogtreecommitdiff
path: root/.bazelci/presubmit.yml
blob: 176e9986146fb926e03c6e38e2c1575e5318a77d (plain)
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
130
131
---
matrix:
  platform:
    - ubuntu1804
    - ubuntu2004
    - macos

.reusable_build_flags: &reusable_build_flags
  ? "--incompatible_config_setting_private_default_visibility"
  ? "--incompatible_disallow_empty_glob"

.reusable_test_flags: &reusable_test_flags
  <<: *reusable_build_flags
  ? "--test_env=PATH"

.reusable_targets: &reusable_targets
  ? "--"
  ? "//..."
  ? "@external_directory_tests//..."
  ? "@bazel_skylib_gazelle_plugin//..."

.reusable_config: &reusable_config
  build_flags: *reusable_build_flags
  test_flags: *reusable_test_flags
  build_targets: *reusable_targets
  test_targets: *reusable_targets

tasks:
  ubuntu2004_bazel5:
    <<: *reusable_config
    name: "Bazel 5.x"
    platform: ubuntu2004
    bazel: 5.x

  ubuntu2004_bazel6:
    <<: *reusable_config
    name: "Bazel 6.x"
    platform: ubuntu2004
    bazel: 6.x
    build_targets:
      <<: *reusable_targets
      # rules_pkg fails with --noenable_bzlmod
      ? "-//distribution/..."
    test_targets:
      <<: *reusable_targets
      # rules_pkg fails with --noenable_bzlmod
      ? "-//distribution/..."

  ubuntu2004_bazel6_enable_bzlmod:
    <<: *reusable_config
    name: "Bazel 6.x with --enable_bzlmod"
    platform: ubuntu2004
    bazel: 6.x
    build_flags:
      <<: *reusable_build_flags
      ? "--enable_bzlmod"
    test_flags:
      <<: *reusable_test_flags
      ? "--enable_bzlmod"

  latest:
    <<: *reusable_config
    name: "Latest Bazel"
    platform: ${{ platform }}
    bazel: latest

  ubuntu2004_latest_noenable_bzlmod:
    <<: *reusable_config
    name: "Latest Bazel with --noenable_bzlmod"
    platform: ubuntu2004
    bazel: latest
    build_flags:
      <<: *reusable_build_flags
      ? "--noenable_bzlmod"
    test_flags:
      <<: *reusable_test_flags
      ? "--noenable_bzlmod"
    build_targets:
      <<: *reusable_targets
      # rules_pkg fails with --noenable_bzlmod
      ? "-//distribution/..."
    test_targets:
      <<: *reusable_targets
      # rules_pkg fails with --noenable_bzlmod
      ? "-//distribution/..."

  ubuntu1604_latest:
    <<: *reusable_config
    name: "Latest Bazel"
    platform: ubuntu1604
    bazel: latest
    build_targets:
      <<: *reusable_targets
      # //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
      ? "-//distribution/..."
    test_targets:
      <<: *reusable_targets
      # //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
      ? "-//distribution/..."

  windows_latest:
    <<: *reusable_config
    name: "Latest Bazel"
    platform: windows
    bazel: latest
    test_flags:
      <<: *reusable_test_flags
      # TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
      # https://github.com/bazelbuild/bazel/issues/7761 is fixed
      ? "--test_env=LOCALAPPDATA"
      ? "--test_tag_filters=-no_windows"

  last_green:
    <<: *reusable_config
    name: "Last Green Bazel"
    platform: ${{ platform }}
    bazel: last_green

  windows_last_green:
    <<: *reusable_config
    name: "Last Green Bazel"
    platform: windows
    bazel: last_green
    test_flags:
      <<: *reusable_test_flags
      # TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
      # https://github.com/bazelbuild/bazel/issues/7761 is fixed
      ? "--test_env=LOCALAPPDATA"
      ? "--test_tag_filters=-no_windows"

buildifier: latest