Skip to content
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

ecosystem CI tests #36

Merged
merged 42 commits into from
Jan 30, 2024
Merged

ecosystem CI tests #36

merged 42 commits into from
Jan 30, 2024

Conversation

jbolda
Copy link
Collaborator

@jbolda jbolda commented Jan 23, 2024

Motivation

To assist in confirming that the built assets run downstream after publishing, we want to test this in CI against the examples repo.

Approach

  • write a setup script that can be run locally and in CI
  • add a workflow that will execute the build and/or tests in the example repo
  • add tests to the example repo (see React Testing Library Example starfx-examples#5)
  • dynamically fetch branch -- use matching branch from starfx-examples if it exists, see below

Dynamic Branch

Additionally, we added a script that will dynamically pull a branch from the examples repo. If the branch name in the current PR running the workflow matches a branch name in the examples repo, it will pull that instead of the main branch. This is to assist in dealing with breaking changes. A PR here and a PR there would allow stepping each forward with a green build.

Screenshots

Branch by default
Screenshot 2024-01-29 at 9 31 51 AM

Branch when a match exists
Screenshot 2024-01-29 at 9 32 33 AM

@jbolda
Copy link
Collaborator Author

jbolda commented Jan 24, 2024

We ended up switching to an npm install.

new Deno.Command("npm", {
      args: ["add", "starfx@file:../../starfx/npm", "--install-links"])

The examples were originally intended to be npm based, and parcel was having trouble with the symlink and additional node_modules. It appeared to be resolving up the tree in this repo.

@parcel/core: Failed to resolve 'react-dom' from 

'/home/runner/work/starfx/starfx/starfx/npm/node_modules/react-redux/es/utils/reactBatchedUpdates.js'
  /home/runner/work/starfx/starfx/starfx/npm/node_modules/react-redux/es/utils/reactBatchedUpdates.js:1:41
  > 1 | export { unstable_batchedUpdates } from 'react-dom';
  >   |                                         ^^^^^^^^^^^
@parcel/resolver-default: Cannot find module 'react-dom'

I left the symlink option in the script as it may be useful in the future for other repos.

@jbolda jbolda marked this pull request as ready for review January 29, 2024 15:37
Copy link
Owner

@neurosnap neurosnap left a comment

Choose a reason for hiding this comment

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

.scripts/ -> scripts/

@jbolda jbolda requested a review from neurosnap January 29, 2024 17:58
Copy link
Owner

@neurosnap neurosnap left a comment

Choose a reason for hiding this comment

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

Thanks so much for all your help, this is great!

@jbolda jbolda merged commit 54f6fc8 into main Jan 30, 2024
4 checks passed
@jbolda jbolda deleted the ecosystem-ci-scaffolding branch January 30, 2024 04:05
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.

2 participants