Skip to content

feat(eval): mlflow evaluator base & migration of text type evaluation to MLflow GenAI #638

feat(eval): mlflow evaluator base & migration of text type evaluation to MLflow GenAI

feat(eval): mlflow evaluator base & migration of text type evaluation to MLflow GenAI #638

Workflow file for this run

name: Generate Preview
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
branches:
- main
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
checks: write
pull-requests: write
concurrency:
group: preview-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-preview:
environment: preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Install dependencies
run: sudo apt install libcairo2-dev pkg-config python3-dev ffmpeg
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Update lockfile
run: uv lock
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run ADT Press
run: |
uv run adt-press.py pdf_path=./assets/raven.pdf label=raven input_language=en page_range.end=5
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Upload preview artifact
uses: actions/upload-artifact@v4
with:
name: preview-${{ github.run_id }}
path: output/raven/
push-azure:
needs: build-preview
environment: preview
runs-on: ubuntu-latest
if: github.event.action != 'closed'
steps:
- name: Download preview artifact
uses: actions/download-artifact@v4
with:
name: preview-${{ github.run_id }}
path: output/raven/
- name: Install azcopy
run: sudo apt install azcopy
- name: Upload to blob storage
run: |
azcopy remove 'https://adtpress.blob.core.windows.net/$web/actions/prs/${{ github.event.number }}/preview?${{ secrets.AZURE_STORAGE_SAS_TOKEN }}' --recursive || true
azcopy copy 'output/raven/*' 'https://adtpress.blob.core.windows.net/$web/actions/prs/${{ github.event.number }}/preview/?${{ secrets.AZURE_STORAGE_SAS_TOKEN }}' --recursive --overwrite=true
- name: Comment PR with preview URL
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
## 🖼 ADT Preview
[View Report](https://adtpress.z1.web.core.windows.net/actions/prs/${{ github.event.number }}/preview/index.html)
[View Generated ADT](https://adtpress.z1.web.core.windows.net/actions/prs/${{ github.event.number }}/preview/adt/sec_p1_s0.html)
*ADT generated for commit: ${{ github.event.pull_request.head.sha }}*
cleanup-azure:
environment: preview
runs-on: ubuntu-latest
if: github.event.action == 'closed'
steps:
- name: Install azcopy
run: sudo apt install azcopy
- name: Delete eval preview from blob storage
run: |
azcopy remove 'https://adtpress.blob.core.windows.net/$web/actions/prs/${{ github.event.number }}/preview?${{ secrets.AZURE_STORAGE_SAS_TOKEN }}' --recursive || true