github.com/bazelbuild/bazel-gazelle@v0.36.1-0.20240520142334-61b277ba6fed/.bazelci/presubmit.yml (about)

     1  ---
     2  matrix:
     3    platform:
     4      - ubuntu2204
     5      - macos
     6    bazel: [6.x, 7.x]
     7    bcr_variant:
     8      - tests/bcr/go_work
     9      - tests/bcr/go_mod
    10  tasks:
    11    ubuntu2204:
    12      name: Ubuntu 22.04 with WORKSPACE
    13      platform: ubuntu2204
    14      bazel: 7.1.1
    15      build_flags:
    16      - "--noexperimental_enable_bzlmod"
    17      test_flags:
    18      - "--noexperimental_enable_bzlmod"
    19      build_targets:
    20      - "..."
    21      run_targets:
    22      # Run Gazelle on repo to verify BUILD files are up-to-date. The output shouldn't differ
    23      # between platforms, so we only run it from one.
    24      - "//:gazelle_ci"
    25      test_targets:
    26      - "..."
    27    ubuntu2204_bzlmod:
    28      name: Ubuntu 22.04 with Bzlmod
    29      platform: ubuntu2204
    30      bazel: 7.1.1
    31      build_targets:
    32      - "..."
    33      run_targets:
    34      # Run Gazelle on repo to verify BUILD files are up-to-date. The output shouldn't differ
    35      # between platforms, so we only run it from one.
    36      - "//:gazelle_ci"
    37      test_targets:
    38      - "..."
    39      - "-//internal:bazel_test"
    40      - "-//cmd/gazelle:gazelle_test"
    41    bcr_tests:
    42      name: BCR test module
    43      platform: ${{ platform }}
    44      bazel: ${{ bazel }}
    45      working_directory: ${{ bcr_variant }}
    46      shell_commands:
    47      # Regenerate the BUILD files for the test module using Gazelle.
    48      # Also verify -repo_config are generated correctly in gazelle.bash
    49      - rm pkg/BUILD.bazel proto/BUILD.bazel
    50      - touch pkg/BUILD.bazel proto/BUILD.bazel
    51      - bazel run //:gazelle -- update pkg proto
    52      - bazel run //:gazelle -- pkg proto
    53      build_targets:
    54      - "//..."
    55      - "//:gazelle"
    56      test_targets:
    57      # Specify these targets explicitly to verify that Gazelle generates them correctly.
    58      - "//pkg:pkg_test"
    59      - "//proto:proto_test"
    60      - "//..."
    61      - "@test_dep//..."
    62    bcr_test_windows:
    63      name: BCR test on Windows
    64      platform: windows
    65      bazel: ${{ bazel }}
    66      working_directory: ${{ bcr_variant }}
    67      shell_commands:
    68      # Regenerate the BUILD file for the test module using Gazelle.
    69      # Also verify -repo_config are generated correctly in gazelle.bash
    70      - rm pkg/BUILD.bazel
    71      - bazel run //:gazelle -- update pkg
    72      - bazel run //:gazelle -- pkg
    73      build_flags:
    74      # Since go_sdk is platform-dependent, the lockfile will differ between
    75      # platforms. We will skip the check on windows.
    76      - "--lockfile_mode=update"
    77      test_flags:
    78      # See above.
    79      - "--lockfile_mode=update"
    80      build_targets:
    81      - "//..."
    82      - "//:gazelle"
    83      test_targets:
    84      # Specify this target explicitly to verify that Gazelle generated it correctly.
    85      - "//pkg:pkg_test"
    86      - "//..."
    87      - "@test_dep//..."
    88    macos_arm64_bzlmod:
    89      name: Mac OS Arm 64 with Bzlmod
    90      platform: macos_arm64
    91      bazel: 7.1.1
    92      build_targets:
    93      - "..."
    94      test_targets:
    95      - "..."
    96      - "-//internal:bazel_test"
    97      - "-//cmd/gazelle:gazelle_test"
    98    macos_arm64:
    99      name: Mac OS Arm 64 with WORKSPACE
   100      platform: macos_arm64
   101      bazel: 7.1.1
   102      build_flags:
   103      - "--noexperimental_enable_bzlmod"
   104      test_flags:
   105      - "--noexperimental_enable_bzlmod"
   106      build_targets:
   107      - "..."
   108      test_targets:
   109      - "..."
   110    macos_bzlmod:
   111      name: Mac OS with Bzlmod
   112      platform: macos
   113      bazel: 7.1.1
   114      build_targets:
   115      - "..."
   116      test_targets:
   117      - "..."
   118      - "-//internal:bazel_test"
   119      - "-//cmd/gazelle:gazelle_test"
   120    macos:
   121      name: Mac OS with WORKSPACE
   122      platform: macos
   123      bazel: 7.1.1
   124      build_flags:
   125      - "--noexperimental_enable_bzlmod"
   126      test_flags:
   127      - "--noexperimental_enable_bzlmod"
   128      build_targets:
   129      - "..."
   130      test_targets:
   131      - "..."
   132    windows_bzlmod:
   133      name: Windows with Bzlmod
   134      platform: windows
   135      bazel: 7.1.1
   136      build_targets:
   137      - "--"
   138      - "..."
   139      - "-//cmd/autogazelle/..."
   140      test_targets:
   141      - "--"
   142      - "..."
   143      - "-//cmd/gazelle:gazelle_test"
   144      # autogazelle is only supported on UNIX-like platforms.
   145      # It requires UNIX domain sockets.
   146      - "-//cmd/autogazelle/..."
   147      # Stardoc produces different line-endings on windows,
   148      # so the documentation it generates doesn't match the checked in files
   149      - "-//docs:all"
   150      # Fails to execute, apparently due to command-line length limit.
   151      - "-//internal:bazel_test"
   152      # gazelle prints file paths with backward slashes on windows,
   153      # which doesn't match the golden files generated on *nix.
   154      - "-//tests:fix_mode_print0"
   155      - "-//tests:fix_mode_strict"
   156    windows:
   157      name: Windows with WORKSPACE
   158      platform: windows
   159      bazel: 7.1.1
   160      build_flags:
   161      - "--noexperimental_enable_bzlmod"
   162      test_flags:
   163      - "--noexperimental_enable_bzlmod"
   164      build_targets:
   165      - "--"
   166      - "..."
   167      - "-//cmd/autogazelle/..."
   168      test_targets:
   169      - "--"
   170      - "..."
   171      # autogazelle is only supported on UNIX-like platforms.
   172      # It requires UNIX domain sockets.
   173      - "-//cmd/autogazelle/..."
   174      # Stardoc produces different line-endings on windows,
   175      # so the documentation it generates doesn't match the checked in files
   176      - "-//docs:all"
   177      # Fails to execute, apparently due to command-line length limit.
   178      - "-//internal:bazel_test"
   179      # gazelle prints file paths with backward slashes on windows,
   180      # which doesn't match the golden files generated on *nix.
   181      - "-//tests:fix_mode_print0"
   182      - "-//tests:fix_mode_strict"
   183    incompatible:
   184      name: Ubuntu 22.04 with WORKSPACE and --config=incompatible
   185      platform: ubuntu2204
   186      bazel: 7.1.1
   187      build_flags:
   188        - "--noexperimental_enable_bzlmod"
   189        - "--config=incompatible"
   190      build_targets:
   191        - "..."
   192      run_targets:
   193        - "//:gazelle_ci"
   194      test_flags:
   195        - "--noexperimental_enable_bzlmod"
   196        - "--config=incompatible"
   197      test_targets:
   198        - "..."