Repository navigation
Add standard Plugin Workflows #3860
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
Open
ryanmelt
wants to merge
1
commit into
main
Choose a base branch
from
standard_plugin_workflows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Builds this plugin and installs it into a real COSMOS with Playwright. | ||
| # | ||
| # Runs the most recent COSMOS Core release in Docker, builds the plugin gem, and | ||
| # drives the Admin tool the way an operator would: Install From File, submit the | ||
| # variables dialog, and wait for the install to report Complete. That catches | ||
| # what unit tests can't - a plugin.txt that doesn't parse, a target that doesn't | ||
| # build, a microservice that won't start. | ||
| # | ||
| # Nothing here needs configuring as the plugin grows. Tool pages are discovered | ||
| # from the COSMOS API after install and checked for browser console errors, and | ||
| # a frontend is built with pnpm whenever the plugin has a package.json, so | ||
| # `cli generate tool` and `cli generate widget` are covered with no edit here. | ||
| # | ||
| # Runs on every commit and once a week. The weekly run is what catches a new | ||
| # COSMOS release breaking this plugin. Note that GitHub disables scheduled | ||
| # workflows in a repo with no activity for 60 days. | ||
|
|
||
| name: Playwright | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: ["**"] | ||
| # Off the hour because scheduled runs at :00 get queued behind everyone else's | ||
| schedule: | ||
| - cron: '27 7 * * 1' | ||
| workflow_dispatch: | ||
| inputs: | ||
| cosmos_version: | ||
| description: 'COSMOS version to run, or latest' | ||
| required: false | ||
| type: string | ||
| default: 'latest' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| # Superseding a pull request run is fine, but a scheduled run and a push to | ||
| # main share a ref, so cancelling on those would have them kill each other | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| playwright: | ||
| uses: OpenC3/.github/.github/workflows/plugin-playwright-reusable.yml@main | ||
| with: | ||
| plugin_directory: . | ||
| cosmos_version: ${{ inputs.cosmos_version || 'latest' }} | ||
| # Once you have added targets with `cli generate target`, list them here | ||
| # and the install is checked for them: | ||
| # expected_targets: MY_TARGET ANOTHER_TARGET | ||
| # | ||
| # install_demo: true # Uncomment if this plugin references INST/INST2 | ||
| # is_tool: true # Uncomment to require that this plugin registers a tool | ||
| # | ||
| # Tool pages are checked for browser console errors automatically. Add | ||
| # regexes here for errors to allow: | ||
| # console_ignore: | | ||
| # some third party gripe | ||
| # another known message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Builds the gem, tags the commit, and creates a GitHub release. Run it by hand | ||
| # from the Actions tab and give it a version number. | ||
| # | ||
| # Both publish steps are off by default so a first release works with no setup | ||
| # at all. Tick the box in the run dialog when you are ready to publish, after | ||
| # adding the matching secret to the repo: | ||
| # | ||
| # Deploy to OpenC3 App Store -> OPENC3_API_TOKEN (your store account token) | ||
| # Publish the gem to RubyGems -> RUBYGEMS_API_KEY (your RubyGems API key) | ||
| # | ||
| # A tool or widget frontend needs nothing set here: once the plugin has a | ||
| # package.json it is built with pnpm before the gem is packaged. | ||
|
|
||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version number' | ||
| required: true | ||
| type: string | ||
| deploy_to_store: | ||
| description: 'Deploy to OpenC3 App Store' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| deploy_to_rubygems: | ||
| description: 'Publish the gem to RubyGems' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| release: | ||
| uses: OpenC3/.github/.github/workflows/release-cosmos-plugin-reusable.yml@main | ||
| with: | ||
| version: ${{ inputs.version }} | ||
| deploy_to_store: ${{ inputs.deploy_to_store }} | ||
| deploy_to_rubygems: ${{ inputs.deploy_to_rubygems }} | ||
| plugin_directory: . | ||
| # is_tool: true # Uncomment to fail the release if package.json is missing | ||
| secrets: | ||
| OPENC3_API_TOKEN: ${{ secrets.OPENC3_API_TOKEN }} | ||
| RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Runs this plugin's unit tests on every push and pull request. | ||
| # | ||
| # Python tests are discovered in tests/ or test/, Ruby specs in spec/ or specs/. | ||
| # Whichever this plugin doesn't have is skipped, so there is nothing to set up: | ||
| # add a test file and it starts running. A plugin with no tests at all passes | ||
| # with a warning until you set require_tests below. | ||
| # | ||
| # Dependencies are picked up automatically - requirements.txt for the code under | ||
| # test, <test dir>/requirements.txt for test only ones, and a Gemfile for Ruby | ||
| # when there is one. | ||
|
|
||
| name: Unit Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: ["**"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| uses: OpenC3/.github/.github/workflows/plugin-unit-tests-reusable.yml@main | ||
| with: | ||
| plugin_directory: . | ||
| # python_version: '3.12' # Uncomment to pin a different Python | ||
| # ruby_version: '3.4' # Uncomment to pin a different Ruby | ||
| # require_tests: true # Uncomment to fail the build when there are no tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We already have this: https://github.com/OpenC3/.github/blob/main/workflow-templates/release-cosmos-plugin.yml. I'd rather you make the changes there than add a new workflow.
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.
I see now that these are separate things but I would still like for them to be somehow unified.
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.
@jmthomas I'm not sure how they would be more unified -- this is "include a GitHub workflow in any generated plugin that will automatically use the OpenC3-provided release workflow"