Skip to content

Bump mheap/github-action-required-labels from 5.4.2 to 5.5.0 (#9980) #51

Bump mheap/github-action-required-labels from 5.4.2 to 5.5.0 (#9980)

Bump mheap/github-action-required-labels from 5.4.2 to 5.5.0 (#9980) #51

Workflow file for this run

name: Javascript Unit Tests
on:
push:
branches:
- "develop"
pull_request:
types: [opened, synchronize, reopened]
# Allows workflow to be called from other workflows
workflow_call:
inputs:
ref:
required: true
type: string
# Avoid duplicate workflows on same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-javascript
cancel-in-progress: true
jobs:
js-unit-tests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Set Python version vars
uses: ./.github/actions/build_info
- name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make develop
run: make develop
- name: Run make protobuf
run: make protobuf
- name: Run make frontend-lib
run: make frontend-lib
- name: Audit frontend licenses
run: ./scripts/audit_frontend_licenses.py
- name: Run type checks
run: make tstypecheck
- name: Run linters
run: make jslint
- name: Validate NOTICES
run: |
# Run `make notices`. If it results in changes, warn the user and fail.
make notices
git_status=$(git status --porcelain -- NOTICES)
if [[ -n $git_status ]]; then
echo "::error::The NOTICES file is out of date! Please run \`make notices\` and commit the result."
echo "::group::git diff NOTICES"
git diff NOTICES
echo "::endgroup::"
exit 1
else
echo "NOTICES is up to date."
fi
- name: Run frontend tests
run: make jstestcoverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_report_vitest
path: |
frontend/lib/coverage
frontend/app/coverage
retention-days: 7
components-lib-tests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
cache-dependency-path: "component-lib/yarn.lock"
- name: Install node dependencies
working-directory: component-lib
run: yarn install
- name: Run frontend tests
working-directory: component-lib
run: yarn test
- name: Build package
working-directory: component-lib
run: yarn build