Skip to content

Add compile-cli-workflows target and CI job for pkg/cli/workflows#31521

Merged
pelikhan merged 4 commits into
mainfrom
copilot/add-makefile-target-compile-workflows
May 11, 2026
Merged

Add compile-cli-workflows target and CI job for pkg/cli/workflows#31521
pelikhan merged 4 commits into
mainfrom
copilot/add-makefile-target-compile-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

New Feature

pkg/cli/workflows compilation was not enforced by a dedicated CI path. This change adds an explicit Makefile target and a CI job so these workflows are compiled on every run.

What does this feature do?

  • Makefile compile target
    • Adds compile-cli-workflows to compile workflow fixtures from pkg/cli/workflows.
    • Compiles from a temporary copied workspace to avoid mutating tracked fixture files.
    • Builds gh-aw only if the binary is missing, so prebuilt binaries can be reused in CI.
  • CI enforcement in ci.yml
    • Adds a compile-cli-workflows job.
    • Downloads the prebuilt gh-aw-linux-amd64 artifact from the update job and uses it for compilation.
    • Runs make compile-cli-workflows to enforce fixture compilation in CI.
  • Target discoverability
    • Adds the new target to make help.

Why is this feature needed?

  • Fixture workflows in pkg/cli/workflows can drift from compiler behavior.
  • A dedicated CI compile path catches regressions immediately and keeps fixtures compile-valid.
  • Reusing the prebuilt compiler artifact avoids redundant builds in the compile job.

Implementation details

.PHONY: compile-cli-workflows
compile-cli-workflows:
	@if [ ! -x "./$(BINARY_NAME)" ]; then \
		echo "./$(BINARY_NAME) not found; building it first..."; \
		$(MAKE) build; \
	fi
	@TMP_WORKFLOWS_DIR=$$(mktemp -d); \
	trap 'rm -rf "$$TMP_WORKFLOWS_DIR"' EXIT; \
	cp -R pkg/cli/workflows "$$TMP_WORKFLOWS_DIR/workflows"; \
	WORKFLOWS=$$(find "$$TMP_WORKFLOWS_DIR/workflows" -maxdepth 1 -type f -name '*.lock.yml' | sed 's/\.lock\.yml$$/.md/' | sort | tr '\n' ' '); \
	./$(BINARY_NAME) compile --fix --no-check-update $$WORKFLOWS

Copilot AI and others added 3 commits May 11, 2026 15:43
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add CLI workflows compile make target and CI job Add compile-cli-workflows target and CI job for pkg/cli/workflows May 11, 2026
Copilot AI requested a review from pelikhan May 11, 2026 15:53
Comment thread .github/workflows/ci.yml
if: ${{ needs.changes.outputs.has_changes == 'true' }}
needs:
- changes
runs-on: ubuntu-latest
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Download the cache containing the built compiler for use in this job.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 6e142e6. The compile-cli-workflows job now depends on update, downloads the gh-aw-linux-amd64 artifact, marks it executable, and uses it for compilation instead of rebuilding in that job.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan May 11, 2026 16:11
@pelikhan pelikhan marked this pull request as ready for review May 11, 2026 16:12
Copilot AI review requested due to automatic review settings May 11, 2026 16:12
@pelikhan pelikhan merged commit 254ebae into main May 11, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/add-makefile-target-compile-workflows branch May 11, 2026 16:13
Copilot stopped work on behalf of pelikhan due to an error May 11, 2026 16:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated Makefile target and CI job to ensure the workflow fixtures under pkg/cli/workflows are compiled during CI runs, reusing a prebuilt gh-aw binary artifact from the existing update job.

Changes:

  • Add compile-cli-workflows Makefile target that compiles workflows from a temporary copied directory to avoid mutating tracked fixtures.
  • Add compile-cli-workflows CI job in ci.yml that downloads the prebuilt gh-aw-linux-amd64 artifact and runs the new Makefile target.
  • Expose the new target via make help.
Show a summary per file
File Description
Makefile Adds compile-cli-workflows target (and help entry) intended to compile pkg/cli/workflows fixtures using a temporary workspace copy.
.github/workflows/ci.yml Adds a new job that downloads the gh-aw artifact from update and runs make compile-cli-workflows to enforce fixture compilation in CI.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread Makefile
Comment on lines +711 to +716
WORKFLOWS=$$(find "$$TMP_WORKFLOWS_DIR/workflows" -maxdepth 1 -type f -name '*.lock.yml' | sed 's/\.lock\.yml$$/.md/' | sort | tr '\n' ' '); \
if [ -z "$$WORKFLOWS" ]; then \
echo "No workflow files found in pkg/cli/workflows"; \
exit 1; \
fi; \
./$(BINARY_NAME) compile --fix --no-check-update $$WORKFLOWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants