-
Notifications
You must be signed in to change notification settings - Fork 56
Add setup-weaver GitHub Action for CI/CD #1036
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
base: main
Are you sure you want to change the base?
Conversation
Add a composite GitHub Action that installs Weaver CLI in GitHub Actions workflows. Changes: - Add setup-weaver action with version pinning and caching support - Support all platforms (Linux, macOS, Windows) - Auto-detect architecture and download appropriate binary - Cache binary for faster subsequent runs (30-60s → 2-5s) - Add comprehensive README with Quick Start and examples Usage: - uses: open-telemetry/weaver/.github/actions/setup-weaver@v1 Update main README to reference setup-weaver action and link to opentelemetry-weaver-examples for complete CI workflow examples.
Simplify the setup-weaver GitHub Action by removing unused outputs and improving step organization: - Remove unused `cache-hit` and `weaver-path` outputs (no consumers use them) - Reorganize steps for clearer flow: install → add to PATH → verify - Separate verification into dedicated step that always runs after PATH is set - Reduce action from 117 to 98 lines (16% reduction) - Improve maintainability by giving each step a single clear responsibility
Add automated testing workflow for the setup-weaver action that: - Tests on all platforms (Linux, Windows, macOS) using matrix - Runs automatically on PRs that modify the action - Verifies the action installs and works correctly - Provides regression protection for action changes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1036 +/- ##
=======================================
+ Coverage 78.7% 79.4% +0.7%
=======================================
Files 82 82
Lines 6612 7033 +421
=======================================
+ Hits 5204 5586 +382
- Misses 1408 1447 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I like being able to offer a github action I however after reading https://docs.github.com/en/actions/how-tos/create-and-publish-actions/publish-in-github-marketplace I see 1 issue when we go to publish it to the marketplace which is that it is not in a seperate repo. This could cause us problems due to the reliance on git tags, what would happen if we did a release for the action, what that break the ability to fetch the latest weaver? Also what would happen when weaver reaches v1.0.0. Hence might be beneficial to request a seperate repo for this functionality ie weaver-setup. |
We don't need to publish to Marketplace for this to work. Users can reference it directly: - uses: open-telemetry/weaver/.github/actions/setup-weaver@mainMarketplace publishing (and potentially moving to a separate repo) could be considered post-v1.0.0 for increased discoverability. For now, the direct repo path keeps things simple while still enabling easier usage for Weaver users. |
lquerel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jerbly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice! Once this is merged I'll review the weaver-examples PR - but that looks good too. Thanks!
|
@kuklyy sure it can be used without marketplace however using your example this would likely lead to issues with this rule https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#pinned-dependencies Is it possible to use a tag rather than simply pointing it to main which would hopefully mitigate that rule? |
Yes, users can reference the action using any git ref (e.g. tag, branch, or commit SHA). The choice of pinning strategy is up to the user - it's not something setup-weaver itself controls. Note that pinning the action version (e.g., Could you please elaborate on what specific change you'd like to see in the Action? Are you suggesting we add documentation about pinning best practices, or something else? |
- Add inline comment showing users can reference action with any git ref (@main, @v0.20.0, @commit-sha) - Simplify version input comment to focus on Weaver CLI version pinning - Clarify distinction between action versioning and CLI tool versioning
Fixes #879
Summary
Add reusable GitHub Action for installing Weaver CLI in CI/CD workflows.
Motivation
Projects using Weaver need a simple, reliable way to install it in GitHub Actions across different platforms.
What's included
.github/actions/setup-weaver/- Cross-platform Weaver installation.github/workflows/test-setup-weaver-action.yml- Automated testing on Linux/macOS/WindowsFeatures
Usage
Testing
See opentelemetry-weaver-examples for real-world usage examples.