feat: color uncolored export widgets #102
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: Python application | |
| on: [push] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| id: setup-python | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - uses: actions/cache@v3 | |
| id: cache-primes | |
| with: | |
| path: venv | |
| key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }} | |
| - name: Install requirements | |
| if: steps.cache-primes.outputs.cache-hit != 'true' | |
| run: | | |
| python -m venv venv | |
| . venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements_dev.txt | |
| - name: Black | |
| continue-on-error: true | |
| run: | | |
| . venv/bin/activate | |
| black --check solid_node tests | |
| - name: Flake8 | |
| continue-on-error: true | |
| run: | | |
| . venv/bin/activate | |
| flake8 --max-line-length=89 solid_node tests | |
| widget: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: solid_node/viewers/widget/package-lock.json | |
| - name: Install widget dependencies | |
| working-directory: solid_node/viewers/widget | |
| run: npm ci | |
| - name: Typecheck widget | |
| working-directory: solid_node/viewers/widget | |
| run: npm run typecheck | |
| - name: Test widget | |
| working-directory: solid_node/viewers/widget | |
| run: npm test | |
| - name: Build widget bundle | |
| working-directory: solid_node/viewers/widget | |
| run: npm run build | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: openscad | |
| version: 1.0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| id: setup-python | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - uses: actions/cache@v3 | |
| id: cache-primes | |
| with: | |
| path: venv | |
| key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }} | |
| - name: Install requirements | |
| if: steps.cache-primes.outputs.cache-hit != 'true' | |
| run: | | |
| python -m venv venv | |
| . venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements_dev.txt | |
| - name: Run tests | |
| run: | | |
| . venv/bin/activate | |
| coverage run --source solid_node -m pytest | |
| coverage report -m | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: solid_node/viewers/widget/package-lock.json | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| cache-dependency-path: | | |
| docs/requirements.txt | |
| requirements.txt | |
| - name: Build widget bundle | |
| working-directory: solid_node/viewers/widget | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Install runtime and docs requirements | |
| run: pip install -r requirements.txt -r docs/requirements.txt | |
| - name: Generate V8 example export | |
| working-directory: docs/examples/v8-engine | |
| run: >- | |
| PYTHONPATH="$GITHUB_WORKSPACE" python -c | |
| "from solid_node.cli import manage; manage()" | |
| export root -o docs/_exports/v8-engine --fps 30 --frames 360 | |
| - name: Build docs (fail on warnings) | |
| run: python -m sphinx -b html -W docs docs/_build | |
| build: | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| needs: [test, widget] | |
| permissions: | |
| contents: write | |
| env: | |
| SOLID_NODE_VERSION: "${{ github.ref_name }}" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| id: setup-python | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install packaging | |
| run: pip install packaging | |
| - name: Detect package version | |
| id: package_version | |
| run: | | |
| from os import getenv as env | |
| from packaging.version import parse | |
| solid_node_version = str(parse(env("SOLID_NODE_VERSION"))) | |
| print(f"version={solid_node_version}", file=open(env("GITHUB_OUTPUT"), "a"), flush=True) | |
| shell: python | |
| - uses: actions/cache@v3 | |
| id: cache-primes | |
| with: | |
| path: venv | |
| key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }} | |
| - name: Install requirements | |
| if: steps.cache-primes.outputs.cache-hit != 'true' | |
| run: | | |
| python -m venv venv | |
| . venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements_dev.txt | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: solid_node/viewers/widget/package-lock.json | |
| - name: Build widget bundle | |
| working-directory: solid_node/viewers/widget | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Build python package | |
| run: | | |
| . venv/bin/activate | |
| make dist | |
| - name: Create release | |
| if: steps.package_version.outputs.version != null | |
| run: | | |
| gh release create ${{ steps.package_version.outputs.version }} ./dist/* --repo="$GITHUB_REPOSITORY" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |