ci: Update TypeScript CI workflow to select tests if test files change (#4840)
* Update TypeScript CI workflow: streamline suite selection and dependency setup - Set default test suites to an empty array to dynamically determine suites based on changes. - Ensure compact JSON output for test suites. - Simplify Node.js and Playwright setup by using built-in caching and custom actions. - Add UV_CACHE_DIR environment variable for caching. * Expand test coverage paths in changes-filter.yaml configuration
This commit is contained in:
parent
043cf14fba
commit
dd92d9c10c
2 changed files with 27 additions and 7 deletions
16
.github/changes-filter.yaml
vendored
16
.github/changes-filter.yaml
vendored
|
|
@ -22,6 +22,7 @@ starter-projects:
|
||||||
- "src/backend/base/langflow/initial_setup/**"
|
- "src/backend/base/langflow/initial_setup/**"
|
||||||
- "src/frontend/src/pages/MainPage/**"
|
- "src/frontend/src/pages/MainPage/**"
|
||||||
- "src/frontend/src/utils/reactflowUtils.ts"
|
- "src/frontend/src/utils/reactflowUtils.ts"
|
||||||
|
- "src/frontend/tests/extended/features/**"
|
||||||
|
|
||||||
components:
|
components:
|
||||||
- "src/frontend/src/components/**"
|
- "src/frontend/src/components/**"
|
||||||
|
|
@ -33,6 +34,12 @@ components:
|
||||||
- "src/frontend/src/style/**"
|
- "src/frontend/src/style/**"
|
||||||
- "src/frontend/src/utils/styleUtils.ts"
|
- "src/frontend/src/utils/styleUtils.ts"
|
||||||
- "src/backend/base/langflow/components/**"
|
- "src/backend/base/langflow/components/**"
|
||||||
|
- "src/frontend/tests/core/features/**"
|
||||||
|
- "src/frontend/tests/core/integrations/**"
|
||||||
|
- "src/frontend/tests/core/regression/**"
|
||||||
|
- "src/frontend/tests/extended/integrations/**"
|
||||||
|
- "src/frontend/tests/extended/features/**"
|
||||||
|
- "src/frontend/tests/extended/regression/**"
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
- "src/backend/base/langflow/inputs/**"
|
- "src/backend/base/langflow/inputs/**"
|
||||||
|
|
@ -43,12 +50,21 @@ workspace:
|
||||||
- "src/frontend/src/CustomEdges/**"
|
- "src/frontend/src/CustomEdges/**"
|
||||||
- "src/frontend/src/utils/reactflowUtils.ts"
|
- "src/frontend/src/utils/reactflowUtils.ts"
|
||||||
- "src/frontend/src/utils/buildUtils.ts"
|
- "src/frontend/src/utils/buildUtils.ts"
|
||||||
|
- "src/frontend/tests/core/features/**"
|
||||||
|
- "src/frontend/tests/core/unit/**"
|
||||||
|
- "src/frontend/tests/extended/features/**"
|
||||||
|
- "src/frontend/tests/core/regression/**"
|
||||||
|
|
||||||
api:
|
api:
|
||||||
- "src/backend/base/langflow/api/**"
|
- "src/backend/base/langflow/api/**"
|
||||||
- "src/frontend/src/controllers/**"
|
- "src/frontend/src/controllers/**"
|
||||||
|
- "src/frontend/tests/core/features/**"
|
||||||
|
- "src/frontend/tests/extended/features/**"
|
||||||
|
- "src/frontend/tests/extended/regression/**"
|
||||||
|
|
||||||
database:
|
database:
|
||||||
- "src/backend/base/langflow/services/database/**"
|
- "src/backend/base/langflow/services/database/**"
|
||||||
- "src/backend/base/langflow/alembic/**"
|
- "src/backend/base/langflow/alembic/**"
|
||||||
- "src/frontend/src/controllers/**"
|
- "src/frontend/src/controllers/**"
|
||||||
|
- "src/frontend/tests/core/features/**"
|
||||||
|
- "src/frontend/tests/extended/features/**"
|
||||||
|
|
|
||||||
18
.github/workflows/typescript_test.yml
vendored
18
.github/workflows/typescript_test.yml
vendored
|
|
@ -81,39 +81,40 @@ jobs:
|
||||||
RELEASE="${{ inputs.release || 'false' }}"
|
RELEASE="${{ inputs.release || 'false' }}"
|
||||||
echo "Release build: $RELEASE"
|
echo "Release build: $RELEASE"
|
||||||
|
|
||||||
if [[ "$RELEASE" == "true" ]]; then
|
# if release OR steps.filter.outputs.frontend-tests is true
|
||||||
|
if [[ "$RELEASE" == "true" || "${{ steps.filter.outputs.frontend-tests }}" == "true" ]]; then
|
||||||
SUITES='["release"]'
|
SUITES='["release"]'
|
||||||
echo "Release build detected - setting suites to: $SUITES"
|
echo "Release build detected - setting suites to: $SUITES"
|
||||||
# No grep pattern for release - run all tests
|
# No grep pattern for release - run all tests
|
||||||
TEST_GREP=""
|
TEST_GREP=""
|
||||||
else
|
else
|
||||||
# If input suites were not provided, determine based on changes
|
# If input suites were not provided, determine based on changes
|
||||||
if [[ "$SUITES" == "[]" ]]; then
|
if [[ "$SUITES" == "[]" ]]; then
|
||||||
echo "No input suites provided - determining from changes"
|
echo "No input suites provided - determining from changes"
|
||||||
TAGS=()
|
TAGS=()
|
||||||
# Add suites and tags based on changed files
|
# Add suites and tags based on changed files
|
||||||
if [[ "${{ steps.filter.outputs.components }}" == "true" ]]; then
|
if [[ "${{ steps.filter.outputs.components }}" == "true" ]]; then
|
||||||
SUITES=$(echo $SUITES | jq '. += ["components"]')
|
SUITES=$(echo $SUITES | jq -c '. += ["components"]')
|
||||||
TAGS+=("@components")
|
TAGS+=("@components")
|
||||||
echo "Added components suite"
|
echo "Added components suite"
|
||||||
fi
|
fi
|
||||||
if [[ "${{ steps.filter.outputs.starter-projects }}" == "true" ]]; then
|
if [[ "${{ steps.filter.outputs.starter-projects }}" == "true" ]]; then
|
||||||
SUITES=$(echo $SUITES | jq '. += ["starter-projects"]')
|
SUITES=$(echo $SUITES | jq -c '. += ["starter-projects"]')
|
||||||
TAGS+=("@starter-projects")
|
TAGS+=("@starter-projects")
|
||||||
echo "Added starter-projects suite"
|
echo "Added starter-projects suite"
|
||||||
fi
|
fi
|
||||||
if [[ "${{ steps.filter.outputs.workspace }}" == "true" ]]; then
|
if [[ "${{ steps.filter.outputs.workspace }}" == "true" ]]; then
|
||||||
SUITES=$(echo $SUITES | jq '. += ["workspace"]')
|
SUITES=$(echo $SUITES | jq -c '. += ["workspace"]')
|
||||||
TAGS+=("@workspace")
|
TAGS+=("@workspace")
|
||||||
echo "Added workspace suite"
|
echo "Added workspace suite"
|
||||||
fi
|
fi
|
||||||
if [[ "${{ steps.filter.outputs.api }}" == "true" ]]; then
|
if [[ "${{ steps.filter.outputs.api }}" == "true" ]]; then
|
||||||
SUITES=$(echo $SUITES | jq '. += ["api"]')
|
SUITES=$(echo $SUITES | jq -c '. += ["api"]')
|
||||||
TAGS+=("@api")
|
TAGS+=("@api")
|
||||||
echo "Added api suite"
|
echo "Added api suite"
|
||||||
fi
|
fi
|
||||||
if [[ "${{ steps.filter.outputs.database }}" == "true" ]]; then
|
if [[ "${{ steps.filter.outputs.database }}" == "true" ]]; then
|
||||||
SUITES=$(echo $SUITES | jq '. += ["database"]')
|
SUITES=$(echo $SUITES | jq -c '. += ["database"]')
|
||||||
TAGS+=("@database")
|
TAGS+=("@database")
|
||||||
echo "Added database suite"
|
echo "Added database suite"
|
||||||
fi
|
fi
|
||||||
|
|
@ -151,6 +152,9 @@ jobs:
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure compact JSON output
|
||||||
|
SUITES=$(echo "$SUITES" | jq -c '.')
|
||||||
|
|
||||||
echo "Final test suites to run: $SUITES"
|
echo "Final test suites to run: $SUITES"
|
||||||
echo "Test grep pattern: $TEST_GREP"
|
echo "Test grep pattern: $TEST_GREP"
|
||||||
# Ensure proper JSON formatting for matrix output
|
# Ensure proper JSON formatting for matrix output
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue