[Prompt Optimization Backend PR #1] Wrap prompt optimize in mlflow jo… #17
This file contains hidden or 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: docs | |
| on: | |
| push: | |
| paths: | |
| - pyproject.toml | |
| - uv.lock | |
| - mlflow/** | |
| - docs/** | |
| - .github/workflows/docs.yml | |
| branches: | |
| - master | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| paths: | |
| - pyproject.toml | |
| - uv.lock | |
| - mlflow/** | |
| - docs/** | |
| - .github/workflows/docs.yml | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: docs | |
| jobs: | |
| check: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| permissions: | |
| contents: read | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: ./.github/actions/setup-node | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| - name: Run lint | |
| run: | | |
| npm run eslint | |
| - name: Run prettier | |
| run: | | |
| npm run prettier:check | |
| build: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| permissions: | |
| contents: read | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: ./.github/actions/setup-java | |
| - uses: ./.github/actions/setup-node | |
| - uses: ./.github/actions/setup-python | |
| - name: Install dependencies | |
| working-directory: . | |
| run: | | |
| uv sync --group docs --extra gateway | |
| - run: | | |
| npm ci | |
| - uses: ./.github/actions/show-versions | |
| - run: | | |
| npm run convert-notebooks | |
| - name: Set alias | |
| id: alias | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| if [ "$EVENT_NAME" = "push" ]; then | |
| ALIAS="dev" | |
| else | |
| ALIAS="pr-$PR_NUMBER" | |
| fi | |
| echo "value=$ALIAS" >> $GITHUB_OUTPUT | |
| echo "$ALIAS" > /tmp/alias.txt | |
| cat /tmp/alias.txt | |
| - name: Build docs | |
| env: | |
| GTM_ID: "GTM-TEST" | |
| API_REFERENCE_PREFIX: https://${{ steps.alias.outputs.value }}--mlflow-docs-preview.netlify.app/docs/ | |
| run: | | |
| npm run build-all -- --no-r --use-npm | |
| - name: Check API inventory | |
| run: | | |
| if [ -n "$(git status --porcelain api_reference/api_inventory.txt)" ]; then | |
| echo "The API inventory file 'docs/api_reference/api_inventory.txt' is outdated (see the diff below)." | |
| echo "Please update it by running 'make rsthtml' in the 'docs/api_reference' directory." | |
| echo "If the new APIs should be marked as experimental, please decorate them with '@experimental'." | |
| echo "Diff:" | |
| git diff api_reference/api_inventory.txt | |
| exit 1 | |
| fi | |
| - name: Check sitemap | |
| run: | | |
| npm run sitemap -- https://mlflow.org/docs/latest/sitemap.xml ./build/latest/sitemap.xml | |
| - name: Move build artifacts | |
| run: | | |
| mkdir -p /tmp/docs-build/docs | |
| mv build/latest /tmp/docs-build/docs/latest | |
| # Create `docs/versions.json` for the version selector in the API reference | |
| VERSION="$(uv version | cut -d' ' -f2)" | |
| echo "{\"versions\": [\"$VERSION\"]}" > /tmp/docs-build/docs/versions.json | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: docs-build-${{ github.run_id }} | |
| path: /tmp/docs-build | |
| retention-days: 1 | |
| if-no-files-found: error | |
| # `github.event.workflow_run.pull_requests` is empty when a PR is created from a fork: | |
| # https://github.com/orgs/community/discussions/25220#discussioncomment-11001085 | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: alias | |
| path: /tmp/alias.txt | |
| retention-days: 1 | |
| if-no-files-found: error | |
| test-examples: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| permissions: | |
| contents: read | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: docs/api_reference | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: ./.github/actions/setup-python | |
| - name: Install dependencies | |
| working-directory: . | |
| run: | | |
| uv sync --group docs --extra gateway | |
| - name: Extract examples | |
| run: | | |
| uv run source/testcode_block.py | |
| - name: Run tests | |
| run: | | |
| uv run pytest .examples | |
| r: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| permissions: | |
| contents: read | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Build docs | |
| working-directory: docs/api_reference | |
| run: | | |
| ./build-rdoc.sh | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "The following files have changed:" | |
| git status --porcelain | |
| exit 1 | |
| fi |