Migrate to uv #6277
Workflow file for this run
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: CI | |
| on: [pull_request, push] | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| jobs: | |
| build-pdf: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install LaTeX | |
| run: | | |
| sudo apt-get -y update | |
| sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk texlive-lang-greek texlive-luatex texlive-xetex texlive-fonts-extra dvipng librsvg2-bin | |
| - name: Build PDF | |
| run: | | |
| uv run make latexpdf | |
| - name: Archive PDF | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frc-docs-pdf | |
| path: build/latex/firstroboticscompetition.pdf | |
| if-no-files-found: error | |
| build-html: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install librsvg2 | |
| run: | | |
| sudo apt-get -y update | |
| sudo apt-get install -y librsvg2-bin | |
| - name: Build HTML | |
| run: | | |
| uv run make html | |
| - name: Archive HTML | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frc-docs-html | |
| path: build/html/ | |
| if-no-files-found: error | |
| build-html-translation: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: wpilibsuite/frc-docs-translations | |
| - name: Delete old submodule | |
| run: | | |
| rm -rf ./frc-docs | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: frc-docs | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install librsvg2 | |
| run: | | |
| sudo apt-get -y update | |
| sudo apt-get install -y librsvg2-bin | |
| - name: Build HTML | |
| run: | | |
| uv run --project frc-docs sphinx-build -D language=es -b html . _build/html | |
| #link-check-diff: | |
| # # This job is sourced from https://github.com/aiven/devportal/blob/main/.github/workflows/linkcheck-changed-files.yaml | |
| # # It is CC 4.0 I licensed: https://creativecommons.org/licenses/by/4.0/ | |
| # # Changes have been made. | |
| # runs-on: ubuntu-24.04 | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - name: Get changed files | |
| # id: changed-files | |
| # uses: tj-actions/changed-files@v41 | |
| # - uses: actions/setup-python@v5 | |
| # with: | |
| # python-version: "3.10" | |
| # - name: Install Dependencies | |
| # run: pip install -r source/requirements.txt | |
| # - name: Run linkcheck on .rst files | |
| # run: | | |
| # for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
| # if [ "${file: -4}" == ".rst" ] | |
| # then | |
| # var="$var $file" | |
| # fi | |
| # done | |
| # if [ -z "$var" ] | |
| # then | |
| # echo "No *.rst changed files to check." | |
| # else | |
| # make BUILDER_ARGS="$var" linkcheck | |
| # fi | |
| check-linting: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install Dependencies | |
| run: | | |
| uv sync | |
| - name: Check Lint | |
| run: | | |
| uv run make lint | |
| check-image-size: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install Dependencies | |
| run: | | |
| uv sync | |
| - name: Check Image Size | |
| run: | | |
| uv run make sizecheck | |
| check-spelling: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: misspell | |
| uses: reviewdog/action-misspell@v1 | |
| with: | |
| locale: "US" | |
| reporter: "github-check" | |
| fail_level: "error" | |
| exclude: | | |
| **/*.svg | |
| check-redirects: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout main | |
| run: | | |
| git fetch origin main --depth=1 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install Dependencies | |
| run: | | |
| uv sync | |
| - name: Check redirects | |
| run: | | |
| uv run make rediraffecheckdiff | |
| - name: Check redirects format | |
| run: | | |
| [[ $(<source/redirects.txt) == $(git show origin/main:source/redirects.txt)* ]] || { echo "Error: redirects.txt can only be appended to. Lines cannot be modified or deleted."; exit 1; } | |
| check-formatting: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Format | |
| run: | | |
| uv run black --check . | |
| check-dependencies: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Check lockfile | |
| run: | | |
| uv lock --check | |
| - name: Export requirements | |
| run: | | |
| uv export --frozen --no-dev --no-editable -o source/requirements.txt | |
| - name: Check for changes | |
| run: | | |
| if ! git diff --exit-code source/requirements.txt; then | |
| echo "Error: source/requirements.txt is out of date. Please run 'uv export --frozen --no-dev --no-editable -o source/requirements.txt' and commit the changes." | |
| exit 1 | |
| fi |