Skip to content

Commit

Permalink
fix: add Bazel version to the run_tests section of BCR presubmit (#403
Browse files Browse the repository at this point in the history
)

- Apply the generate_release_notes_test fix again.
- Add `workflow_dispatch` to the CI workflow.
  • Loading branch information
cgrindel authored Mar 23, 2024
1 parent 56a099d commit e5dbd97
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ bcr_test_module:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
test_targets:
- "//..."
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ name: Continuous Integration
- test_main
schedule:
- cron: 13 11 * * *
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
7 changes: 5 additions & 2 deletions ci/tools/generate_ci_workflow/internal/github/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ func NewWorkflowFromYAML(b []byte) (*Workflow, error) {

// WorkflowTriggers represents the triggers for a workflow.
type WorkflowTriggers struct {
PullRequest PullRequestEvent `yaml:"pull_request"`
Schedule []Schedule `yaml:"schedule,omitempty"`
PullRequest PullRequestEvent `yaml:"pull_request"`
Schedule []Schedule `yaml:"schedule,omitempty"`
WorkflowDispatch WorkflowDispatch `yaml:"workflow_dispatch"`
}

// PullRequestEvent is a trigger event.
Expand All @@ -41,6 +42,8 @@ type Schedule struct {
Cron string `yaml:"cron"`
}

type WorkflowDispatch struct{}

// Concurrency describes how concurrent workflows should be handled.
type Concurrency struct {
Group string `yaml:"group"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ tag="v999.0.0"
# Test with template
actual="$( "${generate_release_notes_with_template_sh}" "${tag}" )"
assert_match "name = \"cgrindel_bazel_starlib\"" "${actual}" "Did not find workspace name."
assert_match "## What's Changed" "${actual}" "Did not find release notes header."
assert_match "## What Has Changed" "${actual}" "Did not find release notes header."
assert_match "bazel_starlib_dependencies()" "${actual}" "Did not find template content."

# Test with workspace_name
actual="$( "${generate_release_notes_with_workspace_name_sh}" "${tag}" )"
assert_match "name = \"foo_bar\"" "${actual}" "Did not find workspace name."
assert_match "## What's Changed" "${actual}" "Did not find release notes header."
assert_match "## What Has Changed" "${actual}" "Did not find release notes header."
assert_match "bazel_starlib_dependencies()" "${actual}" "Did not find template content."
assert_match "bazel_dep\(" "${actual}" "Did not find module snippet"

0 comments on commit e5dbd97

Please sign in to comment.