Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move config for disabling stardoc to bazelrc with config name #70

Merged
merged 8 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ build:ci --config=remote-cache
build:ci --remote_upload_local_results
test:ci --test_output=errors

# No Stardoc
build:no-stardoc --build_tag_filters=-stardoc_generation
test:no-stardoc --test_tag_filters=-stardoc_generation

# Try to load a file that includes the remote cache authentication flag
try-import %workspace%/.bazelrc.auth

Expand Down
38 changes: 16 additions & 22 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,22 @@ jobs:
with:
machine: api.github.com
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure
run: |
cat >>.bazelrc.local <<EOF
build --config=ci
EOF
cat >.bazelrc.disable-stardoc <<-EOF
build --build_tag_filters=-stardoc_generation
test --test_tag_filters=-stardoc_generation
EOF
if [[ ${{ runner.os }} == Windows ]]; then
# Stardoc complains about docstring quote indentation on Windows.
cat .bazelrc.disable-stardoc >>.bazelrc.local
fi
if [[ ${{ matrix.bazel_mode }} == module ]]; then
# Stardoc does not work with bzlmod.
cat .bazelrc.disable-stardoc >>.bazelrc.local
# Test with bzlmod enabled.
cat >>.bazelrc.local <<-EOF
build --experimental_enable_bzlmod
EOF
fi
- name: Configure for CI
uses: tweag/write-bazelrc@v0
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@v0
with:
content: build --config=no-stardoc
- name: Enable bzlmod
uses: tweag/write-bazelrc@v0
if: ${{ matrix.bazel_mode == 'module' }}
with:
content: build --experimental_enable_bzlmod
- name: Run tests (bzlmod)
if: matrix.bazel_mode == 'module'
working-directory: ./tests
Expand Down