Skip to content

Decouple / proper navigation for base_url #1031

Decouple / proper navigation for base_url

Decouple / proper navigation for base_url #1031

Workflow file for this run

name: Frontend Tests & Coverage
on:
push:
branches: [develop]
pull_request:
branches: [develop]
paths:
- "frontend/taipy-gui/**"
workflow_dispatch:
permissions:
# Required to checkout the code
checks: write
# Required to put a comment into the pull-request
pull-requests: write
env:
NODE_OPTIONS: --max-old-space-size=4096
jobs:
frontend-jest:
timeout-minutes: 20
strategy:
matrix:
node-version: [20.x]
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./frontend/taipy-gui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: npm build and test with node ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Hash taipy-gui source code
id: hash-gui-fe
working-directory: ./
run: |
python tools/frontend/hash_source.py --taipy-gui-only
echo "HASH=$(cat hash.txt)" >> $GITHUB_OUTPUT
rm hash.txt
shell: bash
- name: Restore cached frontend build
id: cache-gui-fe-build
uses: actions/cache@v4
with:
path: taipy/gui/webapp
key: taipy-gui-frontend-build-${{ runner.os }}-${{ steps.hash-gui-fe.outputs.HASH }}
- name: Install dom dependencies
if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
working-directory: ./frontend/taipy-gui/dom
run: npm ci
- name: Install dependencies
if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
run: npm ci --omit=optional
- if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
run: npm run build --if-present
- if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
run: npm test
- name: Code coverage
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' && steps.cache-gui-fe-build.outputs.cache-hit != 'true'
uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
threshold: "80"
working-directory: "./frontend/taipy-gui"
skip-step: install
annotations: failed-tests
# use if you want to avoid errors on the base branch coverage (ie no coverage and no comparison but as it fails anyway as it uses npm install)
# base-coverage-file: ./report.json