-
Notifications
You must be signed in to change notification settings - Fork 9.6k
1143 lines (1046 loc) · 45.4 KB
/
Copy pathcross-platform-test.yml
File metadata and controls
1143 lines (1046 loc) · 45.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Cross-Platform Installation Test
on:
workflow_dispatch:
inputs:
langflow-version:
description: "Langflow version to test from PyPI (leave empty to test from source)"
required: false
type: string
default: ""
workflow_call:
inputs:
base-artifact-name:
description: "Name of the base package artifact"
required: false
type: string
core-artifact-name:
description: "Name of the langflow-core package artifact"
required: false
type: string
main-artifact-name:
description: "Name of the main package artifact"
required: false
type: string
lfx-artifact-name:
description: "Name of the LFX package artifact"
required: false
type: string
sdk-artifact-name:
description: "Name of the langflow-sdk package artifact"
required: false
type: string
bundles-artifact-name:
description: "Name of the bundles package artifact (contains every src/bundles/*/ wheel)"
required: false
type: string
pre_release:
description: "Whether this is a pre-release build"
required: false
type: boolean
default: false
jobs:
build-if-needed:
name: Build Packages (if no artifacts provided)
runs-on: ubuntu-latest
if: inputs.langflow-version == '' && contains(github.workflow_ref, 'cross-platform-test.yml')
outputs:
base-artifact-name: ${{ steps.set-names.outputs.base-artifact-name }}
core-artifact-name: ${{ steps.set-names.outputs.core-artifact-name }}
main-artifact-name: ${{ steps.set-names.outputs.main-artifact-name }}
lfx-artifact-name: ${{ steps.set-names.outputs.lfx-artifact-name }}
sdk-artifact-name: ${{ steps.set-names.outputs.sdk-artifact-name }}
bundles-artifact-name: ${{ steps.set-names.outputs.bundles-artifact-name }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- 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: Move base package to correct directory
run: |
# Base package builds to dist/ but should be in src/backend/base/dist/
mkdir -p src/backend/base/dist
mv dist/langflow_base*.whl src/backend/base/dist/
- name: Build core package
run: make build_langflow_core args="--wheel"
- name: Build LFX package
run: |
cd src/lfx
uv build --wheel --out-dir dist
- name: Build SDK package
run: |
cd src/sdk
uv build --wheel --out-dir dist
- name: Build main package
run: make build_langflow args="--wheel"
- name: Build bundle wheels
id: build-bundles
run: |
shopt -s nullglob
bundles=(src/bundles/*/pyproject.toml)
if [ ${#bundles[@]} -eq 0 ]; then
echo "No bundles found under src/bundles/*/"
echo "bundles-found=0" >> $GITHUB_OUTPUT
exit 0
fi
mkdir -p bundles-dist
BUNDLES_DIST="$PWD/bundles-dist"
for bundle_pyproject in "${bundles[@]}"; do
bundle_dir=$(dirname "$bundle_pyproject")
echo "Building wheel for $bundle_dir"
(cd "$bundle_dir" && uv build --wheel --out-dir "$BUNDLES_DIST")
done
echo "bundles-found=1" >> $GITHUB_OUTPUT
ls -la bundles-dist/
- name: Upload lfx artifact
uses: actions/upload-artifact@v6
with:
name: adhoc-dist-lfx
path: src/lfx/dist
- name: Upload SDK artifact
uses: actions/upload-artifact@v6
with:
name: adhoc-dist-sdk
path: src/sdk/dist
- name: Upload base artifact
uses: actions/upload-artifact@v6
with:
name: adhoc-dist-base
path: src/backend/base/dist
- name: Upload core artifact
uses: actions/upload-artifact@v6
with:
name: adhoc-dist-core
path: src/langflow-core/dist
- name: Upload main artifact
uses: actions/upload-artifact@v6
with:
name: adhoc-dist-main
path: dist
- name: Upload bundles artifact
if: steps.build-bundles.outputs.bundles-found == '1'
uses: actions/upload-artifact@v6
with:
name: adhoc-dist-bundles
path: bundles-dist
- name: Set artifact names
id: set-names
run: |
echo "base-artifact-name=adhoc-dist-base" >> $GITHUB_OUTPUT
echo "core-artifact-name=adhoc-dist-core" >> $GITHUB_OUTPUT
echo "main-artifact-name=adhoc-dist-main" >> $GITHUB_OUTPUT
echo "lfx-artifact-name=adhoc-dist-lfx" >> $GITHUB_OUTPUT
echo "sdk-artifact-name=adhoc-dist-sdk" >> $GITHUB_OUTPUT
if [ "${{ steps.build-bundles.outputs.bundles-found }}" = "1" ]; then
echo "bundles-artifact-name=adhoc-dist-bundles" >> $GITHUB_OUTPUT
else
echo "bundles-artifact-name=" >> $GITHUB_OUTPUT
fi
test-installation-stable:
name: Install & Run - ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.python-version }}
needs: [build-if-needed]
if: |
always() &&
(needs.build-if-needed.result == 'success' || needs.build-if-needed.result == 'skipped') &&
(inputs.langflow-version != '' || inputs.main-artifact-name != '' || needs.build-if-needed.outputs.main-artifact-name != '')
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# Linux AMD64
- os: linux
arch: amd64
runner: ubuntu-latest
python-version: "3.10"
- os: linux
arch: amd64
runner: ubuntu-latest
python-version: "3.12"
# macOS AMD64 (Intel) - Python 3.12 only for cost optimization
- os: macos
arch: amd64
runner: macos-latest-large
python-version: "3.12"
# macOS ARM64 (Apple Silicon)
- os: macos
arch: arm64
runner: macos-latest
python-version: "3.10"
- os: macos
arch: arm64
runner: macos-latest
python-version: "3.12"
# Windows AMD64
- os: windows
arch: amd64
runner: windows-latest
python-version: "3.10"
- os: windows
arch: amd64
runner: windows-latest
python-version: "3.12"
# Python 3.13 - graduated from experimental to stable (blocking).
# macOS Intel (amd64) is intentionally omitted here: like 3.10/3.12 above
# it stays on the costly macos-latest-large runner only at 3.12. Intel
# coverage for newer Python continues (non-blocking) in the experimental
# 3.14 set below.
- os: linux
arch: amd64
runner: ubuntu-latest
python-version: "3.13"
- os: macos
arch: arm64
runner: macos-latest
python-version: "3.13"
- os: windows
arch: amd64
runner: windows-latest
python-version: "3.13"
steps:
- name: Determine install method
id: install-method
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
if [ -n "${{ inputs.langflow-version }}" ]; then
echo "method=pypi" >> $GITHUB_OUTPUT
else
echo "method=wheel" >> $GITHUB_OUTPUT
fi
else
# workflow_call always uses wheel method (backward compatibility)
echo "method=wheel" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch == 'amd64' && 'x64' || matrix.arch }}
- name: Setup UV
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
ignore-empty-workdir: true
- name: Install Protocol Buffers (macOS AMD64)
if: matrix.os == 'macos' && matrix.arch == 'amd64'
run: |
if ! command -v protoc &> /dev/null; then
brew install protobuf
else
echo "protoc already installed, skipping"
fi
shell: bash
# Download artifacts for wheel installation
- name: Download langflow-sdk package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.sdk-artifact-name != '' || needs.build-if-needed.outputs.sdk-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.sdk-artifact-name || needs.build-if-needed.outputs.sdk-artifact-name || 'adhoc-dist-sdk' }}
path: ./sdk-dist
- name: Download LFX package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.lfx-artifact-name != '' || needs.build-if-needed.outputs.lfx-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.lfx-artifact-name || needs.build-if-needed.outputs.lfx-artifact-name || 'adhoc-dist-lfx' }}
path: ./lfx-dist
- name: Download base package artifact
if: steps.install-method.outputs.method == 'wheel'
uses: actions/download-artifact@v7
with:
name: ${{ inputs.base-artifact-name || needs.build-if-needed.outputs.base-artifact-name || 'adhoc-dist-base' }}
path: ./base-dist
- name: Download main package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.main-artifact-name != '' || needs.build-if-needed.outputs.main-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.main-artifact-name || needs.build-if-needed.outputs.main-artifact-name || 'adhoc-dist-main' }}
path: ./main-dist
- name: Download bundles package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.bundles-artifact-name != '' || needs.build-if-needed.outputs.bundles-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.bundles-artifact-name || needs.build-if-needed.outputs.bundles-artifact-name }}
path: ./bundles-dist
- name: Create fresh virtual environment
run: |
uv venv test-env --seed
shell: bash
- name: Install packages from wheel
if: steps.install-method.outputs.method == 'wheel'
run: |
set -eo pipefail
shopt -s nullglob
if [ "${{ matrix.os }}" = "windows" ]; then
PYTHON=./test-env/Scripts/python.exe
else
PYTHON=./test-env/bin/python
fi
refresh_find_links() {
FIND_LINKS=()
for wheel_dir in ./sdk-dist ./lfx-dist ./base-dist ./bundles-dist; do
if [ -d "$wheel_dir" ]; then
FIND_LINKS+=(--find-links "$wheel_dir")
fi
done
}
install_wheels() {
label="$1"
shift
if [ "$#" -eq 0 ]; then
echo "No $label wheel found"
exit 1
fi
printf 'Installing %s wheel(s):\n' "$label"
printf '%s\n' "$@"
refresh_find_links
# Use `if-necessary-or-explicit` (not `allow`): nightly langflow* wheels
# are .dev pre-releases so we need to allow them explicitly, but `allow`
# leaks to transitive deps and resolves pre-release pydantic alphas
# (e.g. 2.14.0a1) which break langchain-core's module-level
# `RunnablePassthrough()` call at import time.
uv pip install --prerelease=if-necessary-or-explicit --python "$PYTHON" "${FIND_LINKS[@]}" "$@"
}
SDK_WHEELS=(./sdk-dist/*.whl)
LFX_WHEELS=(./lfx-dist/*.whl)
if [ ${#SDK_WHEELS[@]} -gt 0 ] || [ ${#LFX_WHEELS[@]} -gt 0 ]; then
install_wheels "SDK/LFX" "${SDK_WHEELS[@]}" "${LFX_WHEELS[@]}"
fi
BASE_WHEELS=(./base-dist/*.whl)
install_wheels "base" "${BASE_WHEELS[@]}"
if [ -d ./bundles-dist ]; then
BUNDLE_WHEELS=(./bundles-dist/*.whl)
install_wheels "bundle" "${BUNDLE_WHEELS[@]}"
fi
MAIN_WHEELS=()
while IFS= read -r wheel; do
MAIN_WHEELS+=("$wheel")
done < <(find ./main-dist -name "langflow*.whl" ! -name "langflow_base*.whl" -type f | sort)
if [ ${#MAIN_WHEELS[@]} -ne 1 ]; then
echo "Expected exactly one langflow wheel in ./main-dist, found ${#MAIN_WHEELS[@]}"
find ./main-dist -name "*.whl" -type f | sort
exit 1
fi
install_wheels "main" "${MAIN_WHEELS[@]}"
shell: bash
# PyPI installation steps
- name: Install langflow from PyPI (Windows)
if: steps.install-method.outputs.method == 'pypi' && matrix.os == 'windows'
run: |
if [ -n "${{ inputs.langflow-version }}" ]; then
uv pip install --python ./test-env/Scripts/python.exe langflow==${{ inputs.langflow-version }}
else
uv pip install --python ./test-env/Scripts/python.exe langflow
fi
shell: bash
- name: Install langflow from PyPI (Unix)
if: steps.install-method.outputs.method == 'pypi' && matrix.os != 'windows'
run: |
if [ -n "${{ inputs.langflow-version }}" ]; then
uv pip install --python ./test-env/bin/python langflow==${{ inputs.langflow-version }}
else
uv pip install --python ./test-env/bin/python langflow
fi
shell: bash
# Install additional dependencies
- name: Install additional dependencies (Windows)
if: matrix.os == 'windows'
run: |
uv pip install --python ./test-env/Scripts/python.exe openai
shell: bash
- name: Install additional dependencies (Unix)
if: matrix.os != 'windows'
run: |
uv pip install --python ./test-env/bin/python openai
shell: bash
# Test steps
- name: Test CLI help command
if: matrix.os == 'windows'
run: |
uv run --python ./test-env/Scripts/python.exe python -m langflow --help
shell: cmd
- name: Test CLI help command (Unix)
if: matrix.os != 'windows'
run: |
uv run --python ./test-env/bin/python python -m langflow --help
shell: bash
- name: Test server startup (Windows)
if: matrix.os == 'windows'
timeout-minutes: 5
run: |
# Start server in background
$serverProcess = Start-Process -FilePath ".\test-env\Scripts\python.exe" -ArgumentList "-m", "langflow", "run", "--host", "localhost", "--port", "7860", "--backend-only" -PassThru -WindowStyle Hidden
# Wait for server to be ready (GitHub Actions will timeout after 5 minutes)
do {
try {
$response = Invoke-WebRequest -Uri "http://localhost:7860/health_check" -UseBasicParsing -TimeoutSec 5
if ($response.StatusCode -eq 200) {
Write-Host "✅ Server is ready on ${{ matrix.os }}-${{ matrix.arch }}"
break
}
} catch {
Start-Sleep -Seconds 5
}
} while ($true)
# Stop the server process
Stop-Process -Id $serverProcess.Id -Force -ErrorAction SilentlyContinue
shell: powershell
- name: Test server startup (Unix)
if: matrix.os != 'windows'
timeout-minutes: 5
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
run: |
# Start server in background
./test-env/bin/python -m langflow run --host localhost --port 7860 --backend-only &
SERVER_PID=$!
# Wait for server to be ready (GitHub Actions will timeout after 5 minutes)
while true; do
if curl -f http://localhost:7860/health_check >/dev/null 2>&1; then
echo "✅ Server is ready on ${{ matrix.os }}-${{ matrix.arch }}"
break
fi
sleep 5
done
# Clean shutdown
kill $SERVER_PID 2>/dev/null || true
sleep 5
shell: bash
- name: Test import in Python (Windows)
if: matrix.os == 'windows'
run: |
test-env\Scripts\python.exe -c "
try:
import langflow
print('✅ langflow import successful on ${{ matrix.os }}-${{ matrix.arch }}')
except Exception as e:
print(f'❌ langflow import failed on ${{ matrix.os }}-${{ matrix.arch }}: {e}')
exit(1)
"
shell: cmd
- name: Test import in Python (Unix)
if: matrix.os != 'windows'
run: |
./test-env/bin/python -c "
try:
import langflow
print('✅ langflow import successful on ${{ matrix.os }}-${{ matrix.arch }}')
except Exception as e:
print(f'❌ langflow import failed on ${{ matrix.os }}-${{ matrix.arch }}: {e}')
exit(1)
"
shell: bash
test-installation-experimental:
name: Install & Run - ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.python-version }} (Experimental)
needs: [build-if-needed]
if: |
always() &&
(needs.build-if-needed.result == 'success' || needs.build-if-needed.result == 'skipped') &&
(inputs.langflow-version != '' || inputs.main-artifact-name != '' || needs.build-if-needed.outputs.main-artifact-name != '')
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
# Python 3.14 - Experimental (non-blocking) to monitor ecosystem readiness.
# macOS Intel (x86_64) is intentionally omitted: langflow requires
# onnxruntime>=1.26 on Python >=3.14 (pyproject.toml), but onnxruntime
# dropped macOS x86_64 wheels at 1.24 — so macOS Intel + py3.14 is
# permanently unsatisfiable (older onnxruntime that still ships macOS
# x86_64 wheels has no cp314 ABI). macOS Intel resolves fine through 3.13;
# arm64 has cp314 wheels. Running it would only burn the costly
# macos-latest-large runner on a guaranteed, no-signal failure.
- os: linux
arch: amd64
runner: ubuntu-latest
python-version: "3.14"
- os: windows
arch: amd64
runner: windows-latest
python-version: "3.14"
- os: macos
arch: arm64
runner: macos-latest
python-version: "3.14"
steps:
- name: Determine install method
id: install-method
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
if [ -n "${{ inputs.langflow-version }}" ]; then
echo "method=pypi" >> $GITHUB_OUTPUT
else
echo "method=wheel" >> $GITHUB_OUTPUT
fi
else
# workflow_call always uses wheel method (backward compatibility)
echo "method=wheel" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch == 'amd64' && 'x64' || matrix.arch }}
- name: Setup UV
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
ignore-empty-workdir: true
- name: Install Protocol Buffers (macOS AMD64)
if: matrix.os == 'macos' && matrix.arch == 'amd64'
run: |
if ! command -v protoc &> /dev/null; then
brew install protobuf
else
echo "protoc already installed, skipping"
fi
shell: bash
# Download artifacts for wheel installation
- name: Download langflow-sdk package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.sdk-artifact-name != '' || needs.build-if-needed.outputs.sdk-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.sdk-artifact-name || needs.build-if-needed.outputs.sdk-artifact-name || 'adhoc-dist-sdk' }}
path: ./sdk-dist
- name: Download LFX package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.lfx-artifact-name != '' || needs.build-if-needed.outputs.lfx-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.lfx-artifact-name || needs.build-if-needed.outputs.lfx-artifact-name || 'adhoc-dist-lfx' }}
path: ./lfx-dist
- name: Download base package artifact
if: steps.install-method.outputs.method == 'wheel'
uses: actions/download-artifact@v7
with:
name: ${{ inputs.base-artifact-name || needs.build-if-needed.outputs.base-artifact-name || 'adhoc-dist-base' }}
path: ./base-dist
- name: Download main package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.main-artifact-name != '' || needs.build-if-needed.outputs.main-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.main-artifact-name || needs.build-if-needed.outputs.main-artifact-name || 'adhoc-dist-main' }}
path: ./main-dist
- name: Download bundles package artifact
if: steps.install-method.outputs.method == 'wheel' && (inputs.bundles-artifact-name != '' || needs.build-if-needed.outputs.bundles-artifact-name != '')
uses: actions/download-artifact@v7
with:
name: ${{ inputs.bundles-artifact-name || needs.build-if-needed.outputs.bundles-artifact-name }}
path: ./bundles-dist
- name: Create fresh virtual environment
run: |
uv venv test-env --seed
shell: bash
- name: Install packages from wheel
if: steps.install-method.outputs.method == 'wheel'
run: |
set -eo pipefail
shopt -s nullglob
if [ "${{ matrix.os }}" = "windows" ]; then
PYTHON=./test-env/Scripts/python.exe
else
PYTHON=./test-env/bin/python
fi
refresh_find_links() {
FIND_LINKS=()
for wheel_dir in ./sdk-dist ./lfx-dist ./base-dist ./bundles-dist; do
if [ -d "$wheel_dir" ]; then
FIND_LINKS+=(--find-links "$wheel_dir")
fi
done
}
install_wheels() {
label="$1"
shift
if [ "$#" -eq 0 ]; then
echo "No $label wheel found"
exit 1
fi
printf 'Installing %s wheel(s):\n' "$label"
printf '%s\n' "$@"
refresh_find_links
# See stable job above for rationale on --prerelease=if-necessary-or-explicit.
uv pip install --prerelease=if-necessary-or-explicit --python "$PYTHON" "${FIND_LINKS[@]}" "$@"
}
SDK_WHEELS=(./sdk-dist/*.whl)
LFX_WHEELS=(./lfx-dist/*.whl)
if [ ${#SDK_WHEELS[@]} -gt 0 ] || [ ${#LFX_WHEELS[@]} -gt 0 ]; then
install_wheels "SDK/LFX" "${SDK_WHEELS[@]}" "${LFX_WHEELS[@]}"
fi
BASE_WHEELS=(./base-dist/*.whl)
install_wheels "base" "${BASE_WHEELS[@]}"
if [ -d ./bundles-dist ]; then
BUNDLE_WHEELS=(./bundles-dist/*.whl)
install_wheels "bundle" "${BUNDLE_WHEELS[@]}"
fi
MAIN_WHEELS=()
while IFS= read -r wheel; do
MAIN_WHEELS+=("$wheel")
done < <(find ./main-dist -name "langflow*.whl" ! -name "langflow_base*.whl" -type f | sort)
if [ ${#MAIN_WHEELS[@]} -ne 1 ]; then
echo "Expected exactly one langflow wheel in ./main-dist, found ${#MAIN_WHEELS[@]}"
find ./main-dist -name "*.whl" -type f | sort
exit 1
fi
install_wheels "main" "${MAIN_WHEELS[@]}"
shell: bash
- name: Force reinstall local wheels to prevent downgrades (Windows)
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows'
run: |
# Expose the local wheel dirs so dependency re-resolution (the
# pre-release path below drops --no-deps) can find the local
# pre-release lfx/base wheels. Without these, uv re-resolves
# langflow-base's `lfx>=X.Y.Zrc0` constraint against PyPI only, where
# the matching rc/dev wheel is not published yet, and fails with
# "No solution found when resolving dependencies".
FIND_LINKS=()
for wheel_dir in ./sdk-dist ./lfx-dist ./base-dist ./bundles-dist; do
if [ -d "$wheel_dir" ]; then
FIND_LINKS+=(--find-links "$wheel_dir")
fi
done
# Reinstall LFX if it was provided
if [ -n "${{ inputs.lfx-artifact-name || needs.build-if-needed.outputs.lfx-artifact-name }}" ]; then
LFX_WHEEL=$(find ./lfx-dist -name "*.whl" -type f | head -1)
if [ -n "$LFX_WHEEL" ]; then
echo "Force reinstalling LFX: $LFX_WHEEL"
INSTALL_WHEELS=("$LFX_WHEEL")
SDK_WHEEL=""
if [ -d ./sdk-dist ]; then
SDK_WHEEL=$(find ./sdk-dist -name "*.whl" -type f | head -1)
fi
if [ -n "$SDK_WHEEL" ]; then
echo "Force reinstalling langflow-sdk with LFX: $SDK_WHEEL"
INSTALL_WHEELS=("$SDK_WHEEL" "$LFX_WHEEL")
fi
NO_DEPS="--no-deps"
if [ "${{ inputs.pre_release }}" = "true" ]; then
NO_DEPS=""
fi
uv pip install --force-reinstall $NO_DEPS --prerelease=if-necessary-or-explicit "${FIND_LINKS[@]}" --python ./test-env/Scripts/python.exe "${INSTALL_WHEELS[@]}"
fi
fi
# Reinstall base
BASE_WHEEL=$(find ./base-dist -name "*.whl" -type f | head -1)
if [ -n "$BASE_WHEEL" ]; then
echo "Force reinstalling langflow-base: $BASE_WHEEL"
INSTALL_WHEELS=("$BASE_WHEEL")
NO_DEPS="--no-deps"
if [ "${{ inputs.pre_release }}" = "true" ]; then
# Keep local pre-release roots explicit while re-resolving deps. uv's
# if-necessary-or-explicit mode does not allow pre-release transitive
# deps found only through --find-links, such as langflow-sdk dev wheels.
NO_DEPS=""
LOCAL_WHEELS=()
if [ -d ./sdk-dist ]; then
SDK_WHEEL=$(find ./sdk-dist -name "*.whl" -type f | head -1)
if [ -n "$SDK_WHEEL" ]; then
LOCAL_WHEELS+=("$SDK_WHEEL")
fi
fi
if [ -d ./lfx-dist ]; then
LFX_WHEEL=$(find ./lfx-dist -name "*.whl" -type f | head -1)
if [ -n "$LFX_WHEEL" ]; then
LOCAL_WHEELS+=("$LFX_WHEEL")
fi
fi
INSTALL_WHEELS=("${LOCAL_WHEELS[@]}" "$BASE_WHEEL")
fi
uv pip install --force-reinstall $NO_DEPS --prerelease=if-necessary-or-explicit "${FIND_LINKS[@]}" --python ./test-env/Scripts/python.exe "${INSTALL_WHEELS[@]}"
fi
shell: bash
- name: Force reinstall local wheels to prevent downgrades (Unix)
if: steps.install-method.outputs.method == 'wheel' && matrix.os != 'windows'
run: |
# Expose the local wheel dirs so dependency re-resolution (the
# pre-release path below drops --no-deps) can find the local
# pre-release lfx/base wheels. Without these, uv re-resolves
# langflow-base's `lfx>=X.Y.Zrc0` constraint against PyPI only, where
# the matching rc/dev wheel is not published yet, and fails with
# "No solution found when resolving dependencies".
FIND_LINKS=()
for wheel_dir in ./sdk-dist ./lfx-dist ./base-dist ./bundles-dist; do
if [ -d "$wheel_dir" ]; then
FIND_LINKS+=(--find-links "$wheel_dir")
fi
done
# Reinstall LFX if it was provided
if [ -n "${{ inputs.lfx-artifact-name || needs.build-if-needed.outputs.lfx-artifact-name }}" ]; then
LFX_WHEEL=$(find ./lfx-dist -name "*.whl" -type f | head -1)
if [ -n "$LFX_WHEEL" ]; then
echo "Force reinstalling LFX: $LFX_WHEEL"
INSTALL_WHEELS=("$LFX_WHEEL")
SDK_WHEEL=""
if [ -d ./sdk-dist ]; then
SDK_WHEEL=$(find ./sdk-dist -name "*.whl" -type f | head -1)
fi
if [ -n "$SDK_WHEEL" ]; then
echo "Force reinstalling langflow-sdk with LFX: $SDK_WHEEL"
INSTALL_WHEELS=("$SDK_WHEEL" "$LFX_WHEEL")
fi
NO_DEPS="--no-deps"
if [ "${{ inputs.pre_release }}" = "true" ]; then
NO_DEPS=""
fi
uv pip install --force-reinstall $NO_DEPS --prerelease=if-necessary-or-explicit "${FIND_LINKS[@]}" --python ./test-env/bin/python "${INSTALL_WHEELS[@]}"
fi
fi
# Reinstall base
BASE_WHEEL=$(find ./base-dist -name "*.whl" -type f | head -1)
if [ -n "$BASE_WHEEL" ]; then
echo "Force reinstalling langflow-base: $BASE_WHEEL"
INSTALL_WHEELS=("$BASE_WHEEL")
NO_DEPS="--no-deps"
if [ "${{ inputs.pre_release }}" = "true" ]; then
# Keep local pre-release roots explicit while re-resolving deps. uv's
# if-necessary-or-explicit mode does not allow pre-release transitive
# deps found only through --find-links, such as langflow-sdk dev wheels.
NO_DEPS=""
LOCAL_WHEELS=()
if [ -d ./sdk-dist ]; then
SDK_WHEEL=$(find ./sdk-dist -name "*.whl" -type f | head -1)
if [ -n "$SDK_WHEEL" ]; then
LOCAL_WHEELS+=("$SDK_WHEEL")
fi
fi
if [ -d ./lfx-dist ]; then
LFX_WHEEL=$(find ./lfx-dist -name "*.whl" -type f | head -1)
if [ -n "$LFX_WHEEL" ]; then
LOCAL_WHEELS+=("$LFX_WHEEL")
fi
fi
INSTALL_WHEELS=("${LOCAL_WHEELS[@]}" "$BASE_WHEEL")
fi
uv pip install --force-reinstall $NO_DEPS --prerelease=if-necessary-or-explicit "${FIND_LINKS[@]}" --python ./test-env/bin/python "${INSTALL_WHEELS[@]}"
fi
shell: bash
# PyPI installation steps
- name: Install langflow from PyPI (Windows)
if: steps.install-method.outputs.method == 'pypi' && matrix.os == 'windows'
run: |
if [ -n "${{ inputs.langflow-version }}" ]; then
uv pip install --python ./test-env/Scripts/python.exe langflow==${{ inputs.langflow-version }}
else
uv pip install --python ./test-env/Scripts/python.exe langflow
fi
shell: bash
- name: Install langflow from PyPI (Unix)
if: steps.install-method.outputs.method == 'pypi' && matrix.os != 'windows'
run: |
if [ -n "${{ inputs.langflow-version }}" ]; then
uv pip install --python ./test-env/bin/python langflow==${{ inputs.langflow-version }}
else
uv pip install --python ./test-env/bin/python langflow
fi
shell: bash
# Install additional dependencies
- name: Install additional dependencies (Windows)
if: matrix.os == 'windows'
run: |
uv pip install --python ./test-env/Scripts/python.exe openai
shell: bash
- name: Install additional dependencies (Unix)
if: matrix.os != 'windows'
run: |
uv pip install --python ./test-env/bin/python openai
shell: bash
# Test steps
- name: Test CLI help command (Windows)
if: matrix.os == 'windows'
run: |
uv run --python ./test-env/Scripts/python.exe python -m langflow --help
shell: cmd
- name: Test CLI help command (Unix)
if: matrix.os != 'windows'
run: |
uv run --python ./test-env/bin/python python -m langflow --help
shell: bash
- name: Test server startup (Windows)
if: matrix.os == 'windows'
timeout-minutes: 5
run: |
# Start server in background
$serverProcess = Start-Process -FilePath ".\test-env\Scripts\python.exe" -ArgumentList "-m", "langflow", "run", "--host", "localhost", "--port", "7860", "--backend-only" -PassThru -WindowStyle Hidden
# Wait for server to be ready (GitHub Actions will timeout after 5 minutes)
do {
try {
$response = Invoke-WebRequest -Uri "http://localhost:7860/health_check" -UseBasicParsing -TimeoutSec 5
if ($response.StatusCode -eq 200) {
Write-Host "✅ Server is ready on ${{ matrix.os }}-${{ matrix.arch }}"
break
}
} catch {
Start-Sleep -Seconds 5
}
} while ($true)
# Stop the server process
Stop-Process -Id $serverProcess.Id -Force -ErrorAction SilentlyContinue
shell: powershell
- name: Test server startup (Unix)
if: matrix.os != 'windows'
timeout-minutes: 5
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
run: |
# Start server in background
./test-env/bin/python -m langflow run --host localhost --port 7860 --backend-only &
SERVER_PID=$!
# Wait for server to be ready (GitHub Actions will timeout after 5 minutes)
while true; do
if curl -f http://localhost:7860/health_check >/dev/null 2>&1; then
echo "✅ Server is ready on ${{ matrix.os }}-${{ matrix.arch }}"
break
fi
sleep 5
done
# Clean shutdown
kill $SERVER_PID 2>/dev/null || true
sleep 5
shell: bash
- name: Test import in Python (Windows)
if: matrix.os == 'windows'
run: |
test-env\Scripts\python.exe -c "
try:
import langflow
print('✅ langflow import successful on ${{ matrix.os }}-${{ matrix.arch }}')
except Exception as e:
print(f'❌ langflow import failed on ${{ matrix.os }}-${{ matrix.arch }}: {e}')
exit(1)
"
shell: cmd
- name: Test import in Python (Unix)
if: matrix.os != 'windows'
run: |
./test-env/bin/python -c "
try:
import langflow
print('✅ langflow import successful on ${{ matrix.os }}-${{ matrix.arch }}')
except Exception as e:
print(f'❌ langflow import failed on ${{ matrix.os }}-${{ matrix.arch }}: {e}')
exit(1)
"
shell: bash
test-core-runtime:
name: Core Distribution Wheel - Linux Python 3.14
needs: [build-if-needed]
if: |
always() &&
inputs.langflow-version == '' &&
(needs.build-if-needed.result == 'success' || needs.build-if-needed.result == 'skipped') &&
(inputs.base-artifact-name != '' || inputs.core-artifact-name != '' ||
needs.build-if-needed.outputs.base-artifact-name != '' ||
needs.build-if-needed.outputs.core-artifact-name != '')
runs-on: ubuntu-latest
steps:
- name: Setup UV
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
python-version: "3.14"
- name: Download langflow-sdk package artifact
if: inputs.sdk-artifact-name != '' || needs.build-if-needed.outputs.sdk-artifact-name != ''
uses: actions/download-artifact@v7
with:
name: ${{ inputs.sdk-artifact-name || needs.build-if-needed.outputs.sdk-artifact-name || 'adhoc-dist-sdk' }}
path: ./sdk-dist
- name: Download LFX package artifact
if: inputs.lfx-artifact-name != '' || needs.build-if-needed.outputs.lfx-artifact-name != ''
uses: actions/download-artifact@v7
with:
name: ${{ inputs.lfx-artifact-name || needs.build-if-needed.outputs.lfx-artifact-name || 'adhoc-dist-lfx' }}
path: ./lfx-dist
- name: Download base package artifact
if: inputs.base-artifact-name != '' || needs.build-if-needed.outputs.base-artifact-name != ''
uses: actions/download-artifact@v7
with:
name: ${{ inputs.base-artifact-name || needs.build-if-needed.outputs.base-artifact-name || 'adhoc-dist-base' }}
path: ./base-dist
- name: Download langflow-core package artifact
if: inputs.core-artifact-name != '' || needs.build-if-needed.outputs.core-artifact-name != ''
uses: actions/download-artifact@v7
with:
name: ${{ inputs.core-artifact-name || needs.build-if-needed.outputs.core-artifact-name || 'adhoc-dist-core' }}
path: ./core-dist
- name: Install only core wheels
shell: bash
run: |
set -euo pipefail
shopt -s nullglob
SDK_WHEELS=(./sdk-dist/*.whl)
LFX_WHEELS=(./lfx-dist/*.whl)
BASE_WHEELS=(./base-dist/*.whl)
CORE_WHEELS=(./core-dist/*.whl)
[ ${#SDK_WHEELS[@]} -le 1 ] || { echo "Expected at most one SDK wheel, found ${#SDK_WHEELS[@]}"; exit 1; }
[ ${#LFX_WHEELS[@]} -le 1 ] || { echo "Expected at most one LFX wheel, found ${#LFX_WHEELS[@]}"; exit 1; }
[ ${#BASE_WHEELS[@]} -le 1 ] || { echo "Expected at most one base wheel, found ${#BASE_WHEELS[@]}"; exit 1; }
[ ${#CORE_WHEELS[@]} -le 1 ] || { echo "Expected at most one core wheel, found ${#CORE_WHEELS[@]}"; exit 1; }
FIND_LINKS=()
for directory in sdk-dist lfx-dist base-dist core-dist; do
if [ -d "$directory" ]; then
FIND_LINKS+=(--find-links "./$directory")
fi
done
if [ ${#CORE_WHEELS[@]} -eq 1 ]; then
INSTALL_ROOTS=("${CORE_WHEELS[0]}")
echo "EXPECT_LANGFLOW_CORE=true" >> "$GITHUB_ENV"
elif [ ${#BASE_WHEELS[@]} -eq 1 ]; then
INSTALL_ROOTS=("${BASE_WHEELS[0]}")
echo "EXPECT_LANGFLOW_CORE=false" >> "$GITHUB_ENV"
else
echo "A base or langflow-core wheel is required for the core runtime test."
exit 1
fi
uv venv core-test-env --seed --python 3.14
uv pip install --python core-test-env/bin/python \
--prerelease=if-necessary-or-explicit \
"${FIND_LINKS[@]}" "${SDK_WHEELS[@]}" "${LFX_WHEELS[@]}" "${INSTALL_ROOTS[@]}"
uv pip check --python core-test-env/bin/python
- name: Verify core boundary and indexed imports
shell: bash
run: |
core-test-env/bin/python - <<'PY'
import importlib
import os