PyCafe Playground Links #1540
This file contains 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
name: PyCafe Playground Links | |
on: | |
workflow_run: | |
workflows: [Build] | |
types: | |
- completed | |
defaults: | |
run: | |
working-directory: vizro-core | |
env: | |
PYTHON_VERSION: "3.12" | |
jobs: | |
create-status: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Hatch | |
run: pip install hatch | |
- name: Install Playwright and browser | |
run: | | |
hatch run pip install playwright | |
hatch run playwright install --with-deps chromium | |
# Below: only to have access to vizro-ai latest version in the test_pycafe_links.py and create_pycafe_links_comments.py scripts | |
- name: Install vizro-ai in editable mode to check compatibility with vizro-core and get the version | |
run: | | |
hatch run pip install ../vizro-ai | |
- name: Print PR Number | |
run: | | |
echo "Pull Request Number: ${{ github.event.workflow_run.pull_requests[0].number }}" | |
- name: Test if PyCafe links work with PR # Eventually we should merge this with the create_pycafe_links_comments.py script | |
run: | | |
hatch run python ../tools/pycafe/test_pycafe_links.py --github-token ${{ github.token }} --repo-name ${{ github.repository }} --run-id ${{ github.event.workflow_run.id }} --commit-sha ${{ github.event.workflow_run.head_sha }} | |
- name: Create PyCafe links | |
run: | | |
PR_NUMBER=${{ github.event.workflow_run.pull_requests[0].number || '' }} | |
if [ -n "$PR_NUMBER" ]; then | |
hatch run python ../tools/pycafe/create_pycafe_links_comments.py --github-token ${{ github.token }} --repo-name ${{ github.repository }} --pr-number $PR_NUMBER --run-id ${{ github.event.workflow_run.id }} --commit-sha ${{ github.event.workflow_run.head_sha }} | |
else | |
hatch run python ../tools/pycafe/create_pycafe_links_comments.py --github-token ${{ github.token }} --repo-name ${{ github.repository }} --run-id ${{ github.event.workflow_run.id }} --commit-sha ${{ github.event.workflow_run.head_sha }} | |
fi |