Skip to content

Commit

Permalink
Merge pull request #341 from aherrmann/fixup
Browse files Browse the repository at this point in the history
chore: fix generated files update test
  • Loading branch information
aherrmann authored Jul 7, 2024
2 parents d90bb84 + 7083ad6 commit 2142538
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ common --enable_bzlmod
common --lockfile_mode=off

# docs: https://bazel.build/reference/command-line-reference#flag--incompatible_disallow_empty_glob
common --incompatible_disallow_empty_glob
# TODO re-enable after stardoc was updated on the BCR,
# see https://github.com/bazelbuild/stardoc/commit/c026daeee09fb072a02be87dfc87ea60d157e770#diff-3053677e4333a96b20ed76c662bca07fb2e1ce059479170139209356787da09cL56
common --noincompatible_disallow_empty_glob

# docs: https://bazel.build/reference/command-line-reference#flag--remote_upload_local_results
build --noremote_upload_local_results
Expand Down
14 changes: 9 additions & 5 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ runs:
id: set_bzlmod_flag
shell: bash
run: |
echo "common ${{ inputs.bzlmodEnabled == true && '--enable_bzlmod' || '--noenable_bzlmod' }}" >> .bazelrc.user
echo "bzlmod_flag=${{ inputs.bzlmodEnabled == true && '--enable_bzlmod' || '--noenable_bzlmod' }}" >> $GITHUB_OUTPUT
echo "common ${{ inputs.bzlmodEnabled == 'true' && '--enable_bzlmod' || '--noenable_bzlmod' }}" >> .bazelrc.user
echo "bzlmod_flag=${{ inputs.bzlmodEnabled == 'true' && '--enable_bzlmod' || '--noenable_bzlmod' }}" >> $GITHUB_OUTPUT
- name: Configure documentation generation
if: inputs.folder == '.' && inputs.targetPattern == '//...'
working-directory: ${{ inputs.folder }}
shell: bash
run: |
PREFIX=${{ inputs.docsEnabled == true && '' || 'no' }}
echo "common --$PREFIX@rules_zig//docs:build_docs" >> .bazelrc.user
PREFIX=${{ inputs.docsEnabled == 'true' && '--' || '--no' }}
echo "common $PREFIX@rules_zig//docs:build_docs" >> .bazelrc.user
- name: Configure Zig version
working-directory: ${{ inputs.folder }}
Expand All @@ -96,7 +96,11 @@ runs:
# Bazelisk will download bazel to here, ensure it is cached between runs.
export XDG_CACHE_HOME="$HOME/.cache/bazel-repo"
bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc --bazelrc=.bazelrc run //util:update
test -z $(git status --porcelain) || { echo "Update generated files using `bazel run //util:update`" >&2; git diff >&2; exit 1; }
[ -z "$(git status --porcelain=v1 2>/dev/null)" ] || {
echo 'Update generated files using `bazel run //util:update`' >&2
git --no-pager diff >&2
exit 1
}
- name: Check for test.sh
# Checks for the existence of test.sh in the folder. Downstream steps can use
Expand Down
14 changes: 11 additions & 3 deletions docs/repositories.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions docs/rules.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/toolchains.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2142538

Please sign in to comment.