use astral setup-uv action #15
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: Build | |
| on: | |
| push: | |
| pull_request: | |
| types: [opened, reopened] | |
| jobs: | |
| plotlyjs-dev-build: | |
| name: plotly.js dev build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv sync --extra dev_optional | |
| - name: Update plotly.js to dev | |
| run: | | |
| source .venv/bin/activate | |
| python commands.py updateplotlyjsdev | |
| - name: Test core (excluding nodev) | |
| run: | | |
| source .venv/bin/activate | |
| pytest -k 'not nodev' tests/test_core | |
| - name: Build source distribution packages | |
| run: | | |
| source .venv/bin/activate | |
| uv sync --extra dev_build | |
| python -m build --sdist --wheel -o dist | |
| - name: Upload dist artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: plotlyjs-dev-build-dist | |
| path: dist/ | |
| if-no-files-found: error | |
| full-build: | |
| name: Full prod build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: PyPI Build | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv sync --extra dev_build | |
| cd js | |
| npm ci | |
| npm run build | |
| cd .. | |
| python -m build --sdist --wheel -o dist | |
| cp -R dist output | |
| git status | |
| - name: Zip output | |
| run: | | |
| tar czf output.tgz output | |
| - name: Upload output artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: full-build-output | |
| path: output.tgz | |
| if-no-files-found: error |