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

ci: make pycafe link on each commit / playground #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maartenbreddels
Copy link

Hi Thiago 👋,

This PR adds two github actions that together set up a Python/Streamlit playground with the latest st-annotated-text.

  1. build.yml: build the source distribution into a github artifact
  2. pycafe.yml: creates a snippet link to a PyCafe streamlit app that will install the wheel from 1. into a fresh in-browser Python environment and puts it as a status text (what you normally see next to a commit or at the bottom or a PR).

This process is documented here for one of our libraries. But I wanted to try it out on a streamlit project, and this one was easy to build.

I've tested this out on maartenbreddels#1 to see if it works. It does, and it generates a link in the status:
image

Which should bring you to this playground

The reason that this is not one GitHub action, but two is due to security. The build.yml runs with the permission of the person opening the PR (and thus cannot write the status text). The pycafe.yml workflow runs with your permission (it can write the status text), but run on your master branch (so it does not execute a modified workflow files).

This is super useful for trying out a branch when someone opens a PR, nothing to install, no server running in the background 🍃 and no costs.

Let me know what you think.

Regards,

Maarten

PS: this PR does not write the status text yet, because pycafe.yml should be merged first before it runs, that's why I've created maartenbreddels#1 to show that it works.

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.

1 participant