chore: move config for disabling stardoc to bazelrc with config name #239
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Update version for tweag/write-bazelrc | |
name: Continuous integration | |
on: | |
push: | |
branches: master | |
pull_request: | |
branches: master | |
workflow_dispatch: # allows manual triggering | |
schedule: | |
- cron: '1 11 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
build-and-test: | |
name: Build & Test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-2019] | |
bazel_mode: [workspace, module] | |
version: ["5.3.0", "6.0.0", "7.0.0rc5"] | |
exclude: | |
- version: 5.3.0 | |
bazel_mode: module | |
defaults: | |
run: | |
shell: bash | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazelbuild/setup-bazelisk@v2 | |
- uses: tweag/configure-bazel-remote-cache-auth@v0 | |
with: | |
buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }} | |
bazelrc_path: .bazelrc.auth | |
- name: Configure for CI | |
uses: tweag/write-bazelrc@0ab86694ee69bdeede9416587412e0c5d93f5a44 # cg/initial_implementation | |
with: | |
content: build --config=ci | |
- name: Disable stardoc | |
# Windows: Stardoc complains about docstring quote indentation on Windows. | |
# bzlmod: Stardoc does not work with bzlmod. | |
if: ${{ runner.os == 'Windows' || matrix.bazel_mode == 'module' }} | |
uses: tweag/write-bazelrc@0ab86694ee69bdeede9416587412e0c5d93f5a44 # cg/initial_implementation | |
with: | |
content: build --config=no-stardoc | |
- name: Enable bzlmod | |
uses: tweag/write-bazelrc@0ab86694ee69bdeede9416587412e0c5d93f5a44 # cg/initial_implementation | |
if: ${{ matrix.bazel_mode == 'module' }} | |
with: | |
content: build --experimental_enable_bzlmod | |
- name: Configure | |
run: | | |
cat >~/.netrc <<-EOF | |
machine api.github.com | |
password ${{ secrets.GITHUB_TOKEN }} | |
EOF | |
- name: Run tests (bzlmod) | |
if: matrix.bazel_mode == 'module' | |
working-directory: ./tests | |
run: | | |
echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc | |
if [[ ${{ runner.os }} == Windows ]]; then | |
# On Windows `//...` expands to `/...`. | |
BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... | |
else | |
bazel test //... | |
fi | |
- name: Run tests (workspace) | |
if: matrix.bazel_mode == 'workspace' | |
run: | | |
echo "USE_BAZEL_VERSION=${{ matrix.version }}" > .bazeliskrc | |
echo "USE_BAZEL_VERSION=${{ matrix.version }}" > tests/.bazeliskrc | |
if [[ ${{ runner.os }} == Windows ]]; then | |
# Because of the docstring quote issue on Windows we skip the stardoc test on the main workspace. | |
# On Windows `//...` expands to `/...`. | |
cd tests && BAZEL_SH='C:\msys64\usr\bin\bash.exe' bazel test ///... | |
else | |
bazel test //... | |
cd tests && bazel test //... | |
fi |