123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- name: Partial Tests Workflow
- on:
- workflow_call:
- env:
- NODE_OPTIONS: --max-old-space-size=4096
- jobs:
- linter:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: jpetrucciani/mypy-check@master
- with:
- mypy_flags: "--ignore-missing-imports --implicit-optional --no-namespace-packages --exclude (taipy/templates/|tools/|doc/gui/examples/.*/builder.py) --follow-imports skip --disable-error-code import-untyped"
- - uses: chartboost/ruff-action@v1
- tests:
- needs: linter
- timeout-minutes: 50
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
- os: [ubuntu-latest, windows-latest, macos-13]
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v4
- - uses: dorny/paths-filter@v2
- id: changes
- with:
- filters: |
- cli:
- - 'taipy/_cli/**'
- config:
- - 'taipy/config/**'
- core:
- - 'taipy/core/**'
- gui:
- - 'taipy/gui/**'
- - 'frontend/taipy-gui/**'
- gui-core:
- - 'taipy/gui_core/**'
- logger:
- - 'taipy/logger/**'
- rest:
- - 'taipy/rest/**'
- templates:
- - 'taipy/templates/**'
- - uses: actions/setup-python@v5
- with:
- python-version: ${{matrix.python-version}}
- cache: 'pipenv'
- cache-dependency-path: 'Pipfile'
- - name: Install Setuptools and wheel
- run: pip install --upgrade setuptools wheel
- - name: Install pipenv
- run: pip install --upgrade pipenv
- - name: Install Dependencies
- run: pipenv install --dev --python=${{ matrix.python-version }}
- - name: Setup LibMagic (MacOS)
- if: matrix.os == 'macos-13'
- run: brew install libmagic
- - name: Setup Node
- if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
- uses: actions/setup-node@v4
- with:
- node-version: 20
- cache: 'npm'
- cache-dependency-path: '**/package-lock.json'
- - name: Hash frontend source code
- if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
- id: hash-frontend
- run: |
- pipenv run python tools/frontend/hash_source.py
- echo "HASH=$(cat hash.txt)" >> $GITHUB_OUTPUT
- rm hash.txt
- shell: bash
- - name: Restore cached frontend build
- if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
- id: cache-fe-build
- uses: actions/cache@v4
- with:
- path: |
- taipy/gui/webapp
- taipy/gui_core/lib
- key: frontend-build-${{ runner.os }}-${{ steps.hash-frontend.outputs.HASH }}
- - name: Frontend Bundle Build
- if: (steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true') && steps.cache-fe-build.outputs.cache-hit != 'true'
- run: pipenv run python tools/frontend/bundle_build.py
- - name: Install Playwright
- if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
- run: pipenv run playwright install chromium --with-deps
- - name: Pytest CLI
- if: steps.changes.outputs.cli == 'true'
- run: pipenv run pytest tests/cli
- - name: Pytest Config
- if: steps.changes.outputs.config == 'true'
- run: pipenv run pytest tests/config
- - name: Pytest Core
- if: steps.changes.outputs.core == 'true'
- run: pipenv run pytest -m "not orchestrator_dispatcher and not standalone" tests/core
- - name: Run GUI Test Action
- if: steps.changes.outputs.gui == 'true'
- uses: ./.github/actions/gui-test
- with:
- os: ${{ matrix.os }}
- - name: Pytest GUI Core
- if: steps.changes.outputs.gui-core == 'true'
- run: pipenv run pytest tests/gui_core
- - name: Pytest Logger
- if: steps.changes.outputs.logger == 'true'
- run: pipenv run pytest tests/logger
- - name: Pytest Rest
- if: steps.changes.outputs.rest == 'true'
- run: pipenv run pytest tests/rest
- - name: Pytest Templates
- if: steps.changes.outputs.templates == 'true'
- run: pipenv run pytest tests/templates
- submit_tests:
- needs: linter
- timeout-minutes: 40
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
- os: [ubuntu-latest, windows-latest, macos-13]
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v4
- - uses: dorny/paths-filter@v2
- id: changes
- with:
- filters: |
- core:
- - 'taipy/core/**'
- - name: Setup Python with cache
- if: steps.changes.outputs.core == 'true'
- uses: actions/setup-python@v5
- with:
- python-version: ${{matrix.python-version}}
- cache: 'pipenv'
- cache-dependency-path: 'Pipfile'
- - name: Install pipenv
- if: steps.changes.outputs.core == 'true'
- run: pip install --upgrade pipenv
- - name: Install Dependencies
- if: steps.changes.outputs.core == 'true'
- run: pipenv install --dev --python=${{ matrix.python-version }}
- - name: Setup LibMagic (MacOS)
- if: matrix.os == 'macos-13' && steps.changes.outputs.core == 'true'
- run: brew install libmagic
- - name: Pytest Core orchestrator_dispatcher
- if: steps.changes.outputs.core == 'true'
- run: pipenv run pytest -m "orchestrator_dispatcher" tests/core
- standalone_tests:
- needs: linter
- timeout-minutes: 40
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
- os: [ubuntu-latest, windows-latest, macos-13]
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v4
- - uses: dorny/paths-filter@v2
- id: changes
- with:
- filters: |
- core:
- - 'taipy/core/**'
- - name: Setup Python with cache
- if: steps.changes.outputs.core == 'true'
- uses: actions/setup-python@v5
- with:
- python-version: ${{matrix.python-version}}
- cache: 'pipenv'
- cache-dependency-path: 'Pipfile'
- - name: Install pipenv
- if: steps.changes.outputs.core == 'true'
- run: pip install --upgrade pipenv
- - name: Install Dependencies
- if: steps.changes.outputs.core == 'true'
- run: pipenv install --dev --python=${{ matrix.python-version }}
- - name: Setup LibMagic (MacOS)
- if: matrix.os == 'macos-13' && steps.changes.outputs.core == 'true'
- run: brew install libmagic
- - name: Pytest Core standalone
- if: steps.changes.outputs.core == 'true'
- run: pipenv run pytest -m "standalone" tests/core
|