Skip to content

Commit

Permalink
Merge pull request #70 from tweag/cg/refactor_bazelrc_to_use_configs
Browse files Browse the repository at this point in the history
chore: move config for disabling stardoc to bazelrc with config name
  • Loading branch information
mergify[bot] authored Dec 14, 2023
2 parents 4477ba7 + e51fd44 commit fe066da
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
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

0 comments on commit fe066da

Please sign in to comment.