-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat: Use hybrid approach depending on runner #263
Conversation
eb36561
to
bb834c5
Compare
2506d5d
to
5835751
Compare
934b5e8
to
8350bae
Compare
9d7df48
to
e1429b4
Compare
e1429b4
to
b6fba50
Compare
24f9218
to
f42dbcf
Compare
3e7d7a0
to
8e364cd
Compare
8e364cd
to
f14eba9
Compare
I didn't yet look at the code changes (will do so right after) but I just had an idea:
This immediately raised a red flag tbh because I'm quite sure that I personally would forget this, even after having reviewed this PR. So chances are high someone else would forget this, too. Can we use the |
I added pre-commit hooks for formatting, linting and automatically setting the docker tag based on branch name, all of which are skipped in the case of committing the master tag back for master CI runs. |
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.
Nice, thanks for adding the pre-commit hooks!
Please don't merge this PR yet. I want to ask some users to give it a spin. |
This PR will stay open for a week until March 6th to give users, who graciously helped out testing the PR, a chance to migrate off of it, after which it will be closed in favor of: #265 |
This PR has been duplicated and merged (see #265). |
Background
This PR changes the architecture of the GitHub Action.
Prior to release
1.10.0
, the GitHub Action was only available for Linux based GitHub Action runners, limiting the reach of our Action.With release
1.10.0
the architecture was switched from being a Docker based GitHub Action to a composite GitHub Action. While the bulk of the JavaScript that runs was pre-built, the key piece of the action (@sentry/cli
) was installed on each invocation of the action. This takes a long time, but allows us to support a variety of GitHub runners, for example runners running onmacOS
andWindows
.The hit to execution time (in some cases the action ran 2x as long as before
1.10.0
) and the lack of control over the runner environment and what packages are available (e.g.node
,npm
,yarn
...) meant that many users could not use this new architecture out of the box.On the other hand, we also want to continue supporting non-Linux GitHub Action runners.
Therefore the architecture has been changed to a hybrid approach.
1.10.0
1.10.x
with a difference:node
will now always be set up usingactions/setup-node
regardless of a node version already existing to ensure the action can install@sentry/cli
and run the JavaScript script.Workflow
The development workflow has thus slightly changed as well:
yarn set-docker-tag-from-branch
to set a docker tag based on your git branch name. This is important so that the action gets its own Docker image, allowing you to test the action..github/workflows/build.yml
)yarn install
to install depsyarn build
to build the actiondist/
If you forget to run
yarn set-docker-tag-from-branch
the repo's pre-commit hooks will do it for you and fail the commit.Just add the changes to staging and commit again.