173 lines
No EOL
6.5 KiB
YAML
173 lines
No EOL
6.5 KiB
YAML
name: Cross-Platform Installation Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
base-artifact-name:
|
|
description: "Name of the base package artifact (leave empty to use latest from main branch)"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
main-artifact-name:
|
|
description: "Name of the main package artifact (leave empty to use latest from main branch)"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
test-timeout:
|
|
description: "Timeout for langflow server startup test (minutes)"
|
|
required: false
|
|
type: number
|
|
default: 5
|
|
run-id:
|
|
description: "GitHub run ID to download artifacts from (leave empty for latest successful run)"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
workflow_call:
|
|
inputs:
|
|
base-artifact-name:
|
|
description: "Name of the base package artifact"
|
|
required: true
|
|
type: string
|
|
main-artifact-name:
|
|
description: "Name of the main package artifact"
|
|
required: true
|
|
type: string
|
|
test-timeout:
|
|
description: "Timeout for langflow server startup test (minutes)"
|
|
required: false
|
|
type: number
|
|
default: 5
|
|
|
|
jobs:
|
|
build-if-needed:
|
|
name: Build Packages (if no artifacts provided)
|
|
runs-on: ubuntu-latest
|
|
if: inputs.base-artifact-name == '' || inputs.main-artifact-name == ''
|
|
outputs:
|
|
base-artifact-name: ${{ steps.set-names.outputs.base-artifact-name }}
|
|
main-artifact-name: ${{ steps.set-names.outputs.main-artifact-name }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Setup Environment
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: "3.13"
|
|
- name: Install the project
|
|
run: uv sync
|
|
- name: Install frontend dependencies
|
|
run: make install_frontendci
|
|
- name: Build frontend
|
|
run: make build_frontend
|
|
- name: Build base package
|
|
run: make build_langflow_base args="--wheel"
|
|
- name: Build main package
|
|
run: make build_langflow args="--wheel"
|
|
- name: Upload base artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: adhoc-dist-base
|
|
path: /home/runner/work/langflow/langflow/dist
|
|
- name: Upload main artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: adhoc-dist-main
|
|
path: dist
|
|
- name: Set artifact names
|
|
id: set-names
|
|
run: |
|
|
echo "base-artifact-name=adhoc-dist-base" >> $GITHUB_OUTPUT
|
|
echo "main-artifact-name=adhoc-dist-main" >> $GITHUB_OUTPUT
|
|
- name: Debug artifact names
|
|
run: |
|
|
echo "Build job outputs:"
|
|
echo " base-artifact-name: adhoc-dist-base"
|
|
echo " main-artifact-name: adhoc-dist-main"
|
|
echo "Input parameters:"
|
|
echo " inputs.base-artifact-name: '${{ inputs.base-artifact-name }}'"
|
|
echo " inputs.main-artifact-name: '${{ inputs.main-artifact-name }}'"
|
|
|
|
resolve-parameters:
|
|
name: Resolve Parameters
|
|
needs: [build-if-needed]
|
|
if: always() && (needs.build-if-needed.result == 'success' || needs.build-if-needed.result == 'skipped')
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
base-artifact-name: ${{ steps.resolve.outputs.base-artifact-name }}
|
|
main-artifact-name: ${{ steps.resolve.outputs.main-artifact-name }}
|
|
test-timeout: ${{ steps.resolve.outputs.test-timeout }}
|
|
steps:
|
|
- name: Resolve artifact names
|
|
id: resolve
|
|
run: |
|
|
# Resolve base artifact name
|
|
if [ -n "${{ inputs.base-artifact-name }}" ] && [ "${{ inputs.base-artifact-name }}" != "" ]; then
|
|
BASE_NAME="${{ inputs.base-artifact-name }}"
|
|
elif [ -n "${{ needs.build-if-needed.outputs.base-artifact-name }}" ]; then
|
|
BASE_NAME="${{ needs.build-if-needed.outputs.base-artifact-name }}"
|
|
else
|
|
BASE_NAME="adhoc-dist-base"
|
|
fi
|
|
|
|
# Resolve main artifact name
|
|
if [ -n "${{ inputs.main-artifact-name }}" ] && [ "${{ inputs.main-artifact-name }}" != "" ]; then
|
|
MAIN_NAME="${{ inputs.main-artifact-name }}"
|
|
elif [ -n "${{ needs.build-if-needed.outputs.main-artifact-name }}" ]; then
|
|
MAIN_NAME="${{ needs.build-if-needed.outputs.main-artifact-name }}"
|
|
else
|
|
MAIN_NAME="adhoc-dist-main"
|
|
fi
|
|
|
|
# Resolve test timeout
|
|
if [ -n "${{ inputs.test-timeout }}" ]; then
|
|
TIMEOUT="${{ inputs.test-timeout }}"
|
|
else
|
|
TIMEOUT="5"
|
|
fi
|
|
|
|
echo "base-artifact-name=${BASE_NAME}" >> $GITHUB_OUTPUT
|
|
echo "main-artifact-name=${MAIN_NAME}" >> $GITHUB_OUTPUT
|
|
echo "test-timeout=${TIMEOUT}" >> $GITHUB_OUTPUT
|
|
|
|
echo "Resolved parameters:"
|
|
echo " base-artifact-name: ${BASE_NAME}"
|
|
echo " main-artifact-name: ${MAIN_NAME}"
|
|
echo " test-timeout: ${TIMEOUT}"
|
|
echo ""
|
|
echo "Input values:"
|
|
echo " inputs.base-artifact-name: '${{ inputs.base-artifact-name }}'"
|
|
echo " inputs.main-artifact-name: '${{ inputs.main-artifact-name }}'"
|
|
echo " inputs.test-timeout: '${{ inputs.test-timeout }}'"
|
|
echo " build-if-needed.outputs.base-artifact-name: '${{ needs.build-if-needed.outputs.base-artifact-name }}'"
|
|
echo " build-if-needed.outputs.main-artifact-name: '${{ needs.build-if-needed.outputs.main-artifact-name }}'"
|
|
|
|
test-wheel-installation:
|
|
name: Test Wheel Installation
|
|
needs: [build-if-needed, resolve-parameters]
|
|
if: always() && (needs.build-if-needed.result == 'success' || needs.build-if-needed.result == 'skipped')
|
|
uses: ./.github/workflows/cross-platform-test-shared.yml
|
|
with:
|
|
install-method: "wheel"
|
|
test-timeout: 5
|
|
langflow-version: ""
|
|
base-artifact-name: "adhoc-dist-base"
|
|
main-artifact-name: "adhoc-dist-main"
|
|
run-id: ""
|
|
|
|
test-summary:
|
|
name: Cross-Platform Test Summary
|
|
needs: test-wheel-installation
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
- name: Check test results
|
|
run: |
|
|
if [ "${{ needs.test-wheel-installation.result }}" != "success" ]; then
|
|
echo "❌ Cross-platform tests failed - PyPI upload blocked"
|
|
exit 1
|
|
else
|
|
echo "✅ All cross-platform tests passed - PyPI upload can proceed"
|
|
fi |