Skip to content

[CI] Enable py.cafe in CI #154

[CI] Enable py.cafe in CI

[CI] Enable py.cafe in CI #154

name: PyCafe Dashboards in CI
# defaults:
# run:
# working-directory: vizro-core # but could be any folder
on:
push:
branches: [main]
pull_request:
branches:
- main
env:
PYTHON_VERSION: "3.11"
jobs:
setup-build:
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 dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/tools_requirements.txt
pip install hatch
- name: "Build vizro core package"
run: |
cd vizro-core
hatch build
- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
name: pip
path: vizro-core/dist/*.whl
retention-days: 5
# - name: Fetch latest commit from target branch
# run: |
# # git fetch origin ${{ github.ref_name }}
# latest_commit=${{ github.sha }}
# echo "COMMIT_HASH=$latest_commit" >> $GITHUB_ENV
# run_id=${{ github.run_id }}
# echo "RUN_ID=$run_id" >> $GITHUB_ENV
# - name: Display latest commit
# run: |
# echo "Latest commit on target branch: ${{ env.COMMIT_HASH }}"
# echo "Latest run id: ${{ env.RUN_ID }}"
# - name: Run Py.Cafe tool
# run: |
# python tools/pycafe/create_py_cafe_url.py
- name: Run Github Tool
env:
GITHUB_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.run_id }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_OWNER: mckinsey
run: |
cd vizro-core
hatch run python ../tools/pycafe/test.py examples/scratch_dev/ examples/dev/ examples/visual-vocabulary/