cleanlab--cleanlab
af0f426d9a
GitHub Pages / deploy (push) Has been cancelled
CI / Test: Python 3.10 on macos-13 (push) Has been cancelled
CI / Test: Python 3.11 on macos-13 (push) Has been cancelled
CI / Test: Python 3.8 on macos-13 (push) Has been cancelled
CI / Test: Python 3.9 on macos-13 (push) Has been cancelled
CI / Test: Python 3.10 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.8 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.9 on ubuntu-latest (push) Has been cancelled
CI / Test: Python 3.10 on windows-latest (push) Has been cancelled
CI / Test: Python 3.11 on windows-latest (push) Has been cancelled
CI / Test: Python 3.8 on windows-latest (push) Has been cancelled
CI / Test: Python 3.9 on windows-latest (push) Has been cancelled
CI / Test without optional dependencies and with minimum compatible versions of dependencies (push) Has been cancelled
CI / Type check (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Check for unused/wildcard imports (push) Has been cancelled
CI / Lint Notebooks (push) Has been cancelled
GitHub Markdown Links / test (push) Has been cancelled
GitHub Pages / links (push) Has been cancelled
199 行
7.0 KiB
YAML
199 行
7.0 KiB
YAML
name: GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
|
|
release:
|
|
types: [published]
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-24.04
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Pandoc
|
|
# pin Pandoc version
|
|
run: |
|
|
cd /tmp
|
|
wget https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-linux-amd64.tar.gz
|
|
sudo tar xzvf pandoc-2.19.2-linux-amd64.tar.gz --strip-components 1 -C /usr/local
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: "22"
|
|
|
|
- name: Install FFmpeg
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ffmpeg
|
|
|
|
- name: Upgrade pip
|
|
run: python3 -m pip install --upgrade pip
|
|
|
|
- name: Get pip cache dir
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: ${{ runner.os }}-pip-
|
|
|
|
- name: Install cleanlab
|
|
run: pip install -e ".[all]"
|
|
|
|
- name: Install dependencies
|
|
run: python3 -m pip install -r docs/requirements.txt
|
|
|
|
- name: Install katex
|
|
run: npm install -g katex
|
|
|
|
- name: Find and replace "%pip install cleanlab" with master branch in .ipynb files
|
|
if: ${{ github.ref_type == 'branch' }}
|
|
uses: jacobtomlinson/gha-find-replace@v2
|
|
with:
|
|
find: "%pip install cleanlab ${{ '#' }} for colab"
|
|
replace: "%pip install git+https://github.com/${{ github.repository }}.git@${{ github.sha }}"
|
|
include: "docs/source**.ipynb"
|
|
|
|
- name: Find and replace "%pip install cleanlab" with release tag in .ipynb files
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
uses: jacobtomlinson/gha-find-replace@v2
|
|
with:
|
|
find: "%pip install cleanlab ${{ '#' }} for colab"
|
|
replace: "%pip install cleanlab==${{ github.ref_name }}"
|
|
include: "docs/source**.ipynb"
|
|
|
|
- name: Add and Commit changes to .ipynb files
|
|
run: |
|
|
git config --global user.email "actions@github.com"
|
|
git config --global user.name "GitHub Actions"
|
|
git add -A && git commit -m "Change cleanlab ver in .ipynb files"
|
|
|
|
- name: Change tag to the latest commit
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
run: |
|
|
git tag -f $GITHUB_REF_NAME
|
|
|
|
- name: Run Sphinx with sphinx-multiversion wrapper - branch trigger
|
|
if: ${{ github.ref_type == 'branch' }}
|
|
env:
|
|
TF_CPP_MIN_LOG_LEVEL: 3
|
|
run: sphinx-multiversion docs/source cleanlab-docs -D smv_branch_whitelist=${{ github.ref_name }} -D smv_tag_whitelist=None
|
|
|
|
- name: Run Sphinx with sphinx-multiversion wrapper - tag trigger
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
env:
|
|
TF_CPP_MIN_LOG_LEVEL: 3
|
|
run: sphinx-multiversion docs/source cleanlab-docs -D smv_branch_whitelist=None -D smv_tag_whitelist=${{ github.ref_name }}
|
|
|
|
- name: Get latest stable release
|
|
id: stable_release
|
|
continue-on-error: true
|
|
uses: pozetroninc/github-action-get-latest-release@master
|
|
with:
|
|
owner: ${{ github.repository_owner }}
|
|
repo: cleanlab
|
|
excludes: prerelease, draft
|
|
|
|
- name: Create latest_release.txt file
|
|
if: ${{ steps.stable_release.outcome == 'success' }}
|
|
run: echo ${{ steps.stable_release.outputs.release }} > cleanlab-docs/latest_release.txt
|
|
|
|
- name: Find and replace "placeholder_version_number" in versioning.js
|
|
if: ${{ steps.stable_release.outcome == 'success' }}
|
|
uses: jacobtomlinson/gha-find-replace@v2
|
|
with:
|
|
find: "placeholder_version_number"
|
|
replace: ${{ steps.stable_release.outputs.release }}
|
|
include: "docs/source/_templates/versioning.js"
|
|
|
|
- name: Find and replace "placeholder_commit_hash" in versioning.js
|
|
uses: jacobtomlinson/gha-find-replace@v2
|
|
with:
|
|
find: "placeholder_commit_hash"
|
|
replace: ${{ github.sha }}
|
|
include: "docs/source/_templates/versioning.js"
|
|
|
|
- name: Copy versioning JS file to cleanlab-docs/
|
|
run: |
|
|
cp docs/source/_templates/versioning.js cleanlab-docs/versioning.js
|
|
|
|
- name: Find and replace "stable_url" in redirect-to-stable.html
|
|
if: ${{ github.ref_type == 'tag' && steps.stable_release.outcome == 'success' }}
|
|
uses: jacobtomlinson/gha-find-replace@v2
|
|
with:
|
|
find: "stable_url"
|
|
replace: ${{ env.DOCS_SITE_URL }}stable/index.html
|
|
include: "docs/source/_templates/redirect-to-stable.html"
|
|
|
|
- name: Copy redirecting HTML file to cleanlab-docs/
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
run: cp docs/source/_templates/redirect-to-stable.html cleanlab-docs/index.html
|
|
|
|
- name: Update OpenGraph URLs in HTML files
|
|
# This code fixes the URLs in the HTML files with OpenGraph tags.
|
|
# It uses a regular expression to capture two parts of the URL:
|
|
# $1: The first part of the URL, including the protocol and domain.
|
|
# $2: The rest of the URL, including the path and query string.
|
|
# The replacement string combines the captured parts with the ref name.
|
|
# This ensures that the ref name is inserted into the URL correctly.
|
|
env:
|
|
REF_URL_SEGMENT: ${{ (github.ref_type == 'tag' && steps.stable_release.outcome == 'success') && 'stable' || github.ref_name }}
|
|
uses: jacobtomlinson/gha-find-replace@v2
|
|
with:
|
|
find: '(<meta property="og:url" content="https?://[^/]+)/([^"]+")'
|
|
replace: '$1/${{ env.REF_URL_SEGMENT }}/$2'
|
|
include: "cleanlab-docs/**/*.html"
|
|
regex: true
|
|
|
|
- name: Deploy
|
|
if: ${{ (github.ref == 'refs/heads/master') || (github.ref_type == 'tag') }}
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
external_repository: ${{ github.repository_owner }}/cleanlab-docs
|
|
publish_branch: master
|
|
publish_dir: cleanlab-docs
|
|
keep_files: true
|
|
exclude_assets: ""
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: docs-html
|
|
path: cleanlab-docs
|
|
retention-days: 1 # don't need this except in link checking step below
|
|
|
|
links:
|
|
needs: deploy
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: docs-html
|
|
path: cleanlab-docs
|
|
- uses: anishathalye/proof-html@v1
|
|
with:
|
|
directory: ./cleanlab-docs
|
|
external_only: true
|
|
url_ignore_re: |
|
|
^https://pradyunsg.me/
|
|
^https://keras.io/
|