-
Notifications
You must be signed in to change notification settings - Fork 5.5k
880 lines (782 loc) · 37.3 KB
/
Copy pathci.yml
File metadata and controls
880 lines (782 loc) · 37.3 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
on:
pull_request:
branches:
- 'master'
- '*_release/*'
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
inputs:
runner_type:
required: true
type: choice
options:
- self_hosted
- github_hosted
workflow_call:
name: Warp CI
env:
CARGO_TERM_COLOR: always
NEXTEST_PROFILE: ci
WORKSPACE_TEST_ARGS: --workspace --locked --exclude command-signatures-v2
# Include only as much debug info as is necessary to see backtraces
# in test failures. This should speed up compilation somewhat and
# reduces the size of built artifacts (which addresses issues with
# running out of space on GitHub-hosted runners).
RUSTFLAGS: -C debuginfo=line-tables-only --cfg=web_sys_unstable_apis
# Ensure we open up real windows that render their contents via the GPU,
# so that we can exercise the actual rendering logic.
WARPUI_USE_REAL_DISPLAY_IN_INTEGRATION_TESTS: 1
concurrency:
# Cancel any outstanding CI workflow runs against the same PR.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
params:
name: Compute workflow parameters
timeout-minutes: 3
runs-on: ubuntu-latest
# Don't automatically run CI for draft PRs, to reduce GitHub Actions costs.
#
# Also, don't run CI for repo-sync PRs _unless_ there is a merge conflict - for those,
# we'll want to make sure that the conflict resolution doesn't introduce any issues.
if: >-
github.event.pull_request.draft == false &&
(!startsWith(github.event.pull_request.head.ref, 'repo-sync/') || contains(github.event.pull_request.labels.*.name, 'repo-sync:conflict')) &&
github.repository_owner == 'warpdotdev'
outputs:
affects-database-schema: ${{ github.ref == 'master' || steps.filter.outputs.affects-database-schema }}
affects-rust-sources: ${{ github.ref == 'master' || steps.filter.outputs.affects-rust-sources }}
macos-runner: ${{ steps.mac_runner_type.outputs.value }}
wasm-runner: ${{ steps.wasm_runner_type.outputs.value }}
steps:
- name: Checkout sources
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Check changed files
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: filter
with:
filters: |
affects-database-schema:
- 'crates/persistence/src/schema.rs'
- 'crates/persistence/migrations/**'
affects-rust-sources:
- '**.rs'
- name: Determine macOS runner type
id: mac_runner_type
run: |
RUNNER_TYPE='["namespace-profile-mac-ci"]'
echo "value=$RUNNER_TYPE" >> $GITHUB_OUTPUT
- name: Determine wasm runner type
id: wasm_runner_type
run: |
# Use a larger (16 core, 64GB ram) runner on Linux to speed up execution time.
# https://github.com/warpdotdev/warp-internal/settings/actions/runners
RUNNER_TYPE='["ubuntu-latest-large"]'
echo "value=$RUNNER_TYPE" >> $GITHUB_OUTPUT
tests:
name: Run ${{ matrix.name }} tests
timeout-minutes: 25
env:
# When CI runs on a PR from a fork, the GCP OIDC auth used by
# `google-github-actions/auth` fails because our Workload Identity
# Federation provider is configured to only trust the base repository.
# We skip the auth + gcloud install steps in those runs and exclude SSH
# integration tests (which require gcloud to tunnel into a GCP test VM)
# via the filter suffix below. Tests that need gcloud either have
# `_ssh_` in their name or exercise the remote-server SSH path. Fork PRs
# lose SSH integration test coverage; those tests still run post-merge
# against `master`.
HAS_GCP_AUTH: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
EXCLUDE_SSH_TESTS_FILTER: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && ' and not test(/(_ssh_|remote_server)/)' || '' }}
EXCLUDE_REMOTE_SERVER_TESTS_FILTER: " and not test(/remote_server/)"
strategy:
fail-fast: false
matrix:
include:
- os: "macos"
name: "MacOS"
runner: ${{ fromJSON(needs.params.outputs.macos-runner) }}
is_self_hosted: ${{ contains(fromJSON(needs.params.outputs.macos-runner), 'self-hosted') }}
extra_test_args: ""
- os: "linux"
name: "Linux"
# Use a larger (16 core, 64GB ram) runner on Linux to speed up execution time.
# https://github.com/warpdotdev/warp-internal/settings/actions/runners
runner: ubuntu-latest-large
# We don't (yet) have any self-hosted Linux runners.
is_self_hosted: false
extra_test_args: ""
- os: "windows"
name: "Windows"
runner: windows-latest-large
# We don't (yet) have any self-hosted Windows runners.
is_self_hosted: false
extra_test_args: "--exclude command-signatures-v2 --exclude warp_js"
runs-on: ${{ matrix.runner }}
needs: params
# Make sure an ID token is created with the necessary permissions to use
# GCP's Workload Identity Federation (for service account authentication).
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/prepare_environment
with:
target_os: ${{ matrix.os }}
is_self_hosted: ${{ matrix.is_self_hosted }}
install_test_deps: true
- name: Install Shells
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30 # v1
if: ${{ matrix.is_self_hosted == false }}
with:
apt: zsh fish
brew: fish bash
- name: Echo Shells (UNIX)
id: echo_shells_unix
if: ${{ matrix.os != 'windows' }}
shell: bash
run: |
if ${{ matrix.os == 'macos' }}; then
LATEST_BASH_PATH="$(brew --prefix bash)/bin/bash"
echo "latest_bash_path=$LATEST_BASH_PATH" >> $GITHUB_OUTPUT
LATEST_BASH_VERSION="$($LATEST_BASH_PATH --version)"
echo "::notice title=${{ matrix.name }} Tests - Latest Bash Version::$LATEST_BASH_VERSION"
fi
DEFAULT_BASH_PATH="$(command -pv bash)"
DEFAULT_BASH_VERSION="$($DEFAULT_BASH_PATH --version)"
echo "default_bash_path=$DEFAULT_BASH_PATH" >> $GITHUB_OUTPUT
echo "::notice title=${{ matrix.name }} Tests - Default Bash Version::$DEFAULT_BASH_VERSION"
FISH_PATH="$(which fish)"
echo "fish_path=$FISH_PATH" >> $GITHUB_OUTPUT
FISH_VERSION="$($FISH_PATH --version)"
echo "::notice title=${{ matrix.name }} Tests - Fish Version::$FISH_VERSION"
ZSH_VERSION="$(zsh --version)"
ZSH_PATH="$(which zsh)"
echo "zsh_path=$ZSH_PATH" >> $GITHUB_OUTPUT
echo "::notice title=${{ matrix.name }} Tests - Zsh Version::$ZSH_VERSION"
POWERSHELL_PATH="$(which pwsh)"
POWERSHELL_VERSION=$(pwsh -version | awk '{print $2}')
echo "powershell_path=$POWERSHELL_PATH" >> $GITHUB_OUTPUT
echo "::notice title=${{ matrix.name }} Tests - Powershell Version::$POWERSHELL_VERSION"
- name: Echo Shells (Windows)
id: echo_shells_windows
if: ${{ matrix.os == 'windows' }}
shell: pwsh
run: |
$env:POWERSHELL_PATH = (Get-Command pwsh).Source
$env:POWERSHELL_VERSION = (Get-Command pwsh).Version.Major
Write-Output 'Powershell path:' $env:POWERSHELL_PATH
Write-Output 'Powershell version:' $env:POWERSHELL_VERSION
Write-Output "powershell_path=$env:POWERSHELL_PATH" >> $env:GITHUB_OUTPUT
Write-Output "::notice title=${{ matrix.name }} Tests - Powershell Version::$env:POWERSHELL_VERSION"
- name: Echo Default Shell
id: echo_default_shell
shell: bash
run: |
if ${{ matrix.os == 'windows' }}; then
DEFAULT_SHELL="${{ steps.echo_shells_windows.outputs.powershell_path }}"
else
DEFAULT_SHELL="${{ steps.echo_shells_unix.outputs.zsh_path }}"
fi
echo "Using default shell '$DEFAULT_SHELL'"
echo "default_shell_path=$DEFAULT_SHELL" >> $GITHUB_OUTPUT
- name: Install cargo nextest
if: ${{ matrix.is_self_hosted == false }}
uses: taiki-e/install-action@16b05812d776ae1dfaabc8277e421fb6d2506419 # v2.82.7
with:
tool: nextest
- name: Run ssh-agent for SSH tests
if: ${{ matrix.os == 'linux' }}
run: |
# Create the .ssh dir.
mkdir -p ~/.ssh
# Run the agent.
eval "$(ssh-agent -s)"
# Persist the SSH_AUTH_SOCK and SSH_AGENT_PID for future steps
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
- name: Set up gcloud authentication for SSH tests
# Skipped for fork PRs - see HAS_GCP_AUTH definition above.
if: env.HAS_GCP_AUTH == 'true'
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
with:
workload_identity_provider: projects/63595664881/locations/global/workloadIdentityPools/github-pool/providers/github-provider
service_account: github-ci-workflow@warp-ssh-integration-testing.iam.gserviceaccount.com
- name: Install gcloud CLI tool
# Skipped for fork PRs - see HAS_GCP_AUTH definition above.
if: env.HAS_GCP_AUTH == 'true'
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
with:
version: '>= 397.0.0'
- name: Install vim for richer alt-screen tests
if: ${{ matrix.is_self_hosted == false }}
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30 # v1
with:
brew: vim
apt: vim
- name: Compile tests
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} --no-run
env:
# Attach the GitHub auth token so that requests to the GitHub API
# don't get rate limited during compilation (e.g.: retrieving
# Sentry SDK binary releases).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests
# Unlike later test steps, only run this if previous steps succeed (so
# that we don't bother running these first tests if test compilation
# fails).
if: success()
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "not package(integration)"
env:
# Unit tests may end up spawning a shell, but shouldn't care which
# shell it is. We'll use zsh, as it has the shortest bootstrap times
# and tends to be the most reliable.
WARP_SHELL_PATH: ${{ steps.echo_default_shell.outputs.default_shell_path }}
- name: Upload results of unit tests to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=unit
variant: ${{ matrix.os }}
use-cache: true
- name: Run shell-agnostic integration tests
# Run this step even if a previous test step fails
if: matrix.os != 'windows' && (success() || failure())
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "package(integration) and not test(shell_integration_tests)${{ env.EXCLUDE_SSH_TESTS_FILTER }}${{ env.EXCLUDE_REMOTE_SERVER_TESTS_FILTER }}"
env:
# We run shell-agnostic tests against zsh, as it has the shortest
# bootstrap times and tends to be the most reliable.
WARP_SHELL_PATH: ${{ steps.echo_shells_unix.outputs.zsh_path }}
- name: Upload results of shell-agnostic integration tests to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ matrix.os != 'windows' && !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=shell-agnostic
variant: ${{ matrix.os }}
use-cache: true
- name: Run shell integration tests against default version of bash
# Run this step even if a previous test step fails
if: matrix.os != 'windows' && (success() || failure())
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "package(integration) and test(shell_integration_tests)${{ env.EXCLUDE_SSH_TESTS_FILTER }}${{ env.EXCLUDE_REMOTE_SERVER_TESTS_FILTER }}"
env:
WARP_SHELL_PATH: ${{ steps.echo_shells_unix.outputs.default_bash_path }}
- name: Upload results of shell integration tests against default version of bash to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ matrix.os != 'windows' && !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=bash-default
variant: ${{ matrix.os }}
use-cache: true
- name: Run shell integration tests against latest version of bash
# Run this step even if a previous test step fails.
# We only run this on MacOS since the default Bash version on Mac
# was released in 2007. Most Linux distros ship with a relatively
# new (version 5.0+) version of Bash.
if: (success() || failure()) && runner.os == 'macos'
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "package(integration) and test(shell_integration_tests)${{ env.EXCLUDE_SSH_TESTS_FILTER }}${{ env.EXCLUDE_REMOTE_SERVER_TESTS_FILTER }}"
env:
WARP_SHELL_PATH: ${{ steps.echo_shells_unix.outputs.latest_bash_path }}
- name: Upload results of shell integration tests against latest version of bash to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ matrix.os != 'windows' && !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=bash-latest
variant: ${{ matrix.os }}
use-cache: true
- name: Run shell integration tests against fish
# Run this step even if a previous test step fails
if: matrix.os != 'windows' && (success() || failure())
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "package(integration) and test(shell_integration_tests)${{ env.EXCLUDE_SSH_TESTS_FILTER }}${{ env.EXCLUDE_REMOTE_SERVER_TESTS_FILTER }}"
env:
WARP_SHELL_PATH: ${{ steps.echo_shells_unix.outputs.fish_path }}
- name: Upload results of shell integration tests against fish to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ matrix.os != 'windows' && !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=fish
variant: ${{ matrix.os }}
use-cache: true
- name: Run shell integration tests against zsh
# Run this step even if a previous test step fails
if: matrix.os != 'windows' && (success() || failure())
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "package(integration) and test(shell_integration_tests)${{ env.EXCLUDE_SSH_TESTS_FILTER }}${{ env.EXCLUDE_REMOTE_SERVER_TESTS_FILTER }}"
env:
WARP_SHELL_PATH: ${{ steps.echo_shells_unix.outputs.zsh_path }}
- name: Upload results of shell integration tests against zsh to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ matrix.os != 'windows' && !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=zsh
variant: ${{ matrix.os }}
use-cache: true
- name: Run shell integration tests against powershell
# Run this step even if a previous test step fails
if: matrix.os != 'windows' && (success() || failure())
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} -E "package(integration) and test(shell_integration_tests)${{ env.EXCLUDE_SSH_TESTS_FILTER }}${{ env.EXCLUDE_REMOTE_SERVER_TESTS_FILTER }}"
env:
WARP_SHELL_PATH: ${{ steps.echo_shells_unix.outputs.powershell_path }}
- name: Upload results of shell integration tests against powershell to trunk.io
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: ${{ matrix.os != 'windows' && !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=powershell
variant: ${{ matrix.os }}
use-cache: true
# Run doctests explicitly, as nextest doesn't yet support running them.
# See: https://github.com/nextest-rs/nextest/issues/16
- name: Run doc tests
# Run this step even if a previous test step fails
if: success() || failure()
run: cargo test ${{ env.WORKSPACE_TEST_ARGS }} ${{ matrix.extra_test_args }} --doc
# Run warp_completer tests with the "v2" (completions-on-js) flag enabled. We do this to
# ensure that the v2 completions implementation doesn't regress/rot while it's development
# is paused.
- name: Run completions-on-js tests
# Run this step even if a previous test step fails
if: matrix.os != 'windows' && (success() || failure())
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run --locked -p warp_completer --features v2
# This is longer than we like and temporary until we speed up integration tests
# The maximum timeout for the entire job is 6 hours:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes
remote-server-tests:
name: Run Linux remote-server integration tests
# Temporarily disabled while reconsidering the approach.
if: false
timeout-minutes: 25
runs-on: ubuntu-latest-large
needs: params
concurrency:
# The dedicated VM uses a fixed binary path, so serialize remote-server
# deploy/test jobs across workflow runs to avoid cross-run clobbering.
group: remote-server-test-vm
cancel-in-progress: false
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/prepare_environment
with:
target_os: linux
is_self_hosted: false
install_test_deps: true
- name: Install Shells
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30 # v1
with:
apt: zsh fish
- name: Echo default Bash
id: echo_bash
shell: bash
run: |
DEFAULT_BASH_PATH="$(command -pv bash)"
echo "default_bash_path=$DEFAULT_BASH_PATH" >> $GITHUB_OUTPUT
DEFAULT_BASH_VERSION="$($DEFAULT_BASH_PATH --version)"
echo "::notice title=Remote Server Tests - Default Bash Version::$DEFAULT_BASH_VERSION"
- name: Install cargo nextest
uses: taiki-e/install-action@16b05812d776ae1dfaabc8277e421fb6d2506419 # v2.82.7
with:
tool: nextest
- name: Set up gcloud authentication for remote-server tests
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
with:
workload_identity_provider: projects/63595664881/locations/global/workloadIdentityPools/github-pool/providers/github-provider
service_account: github-ci-workflow@warp-ssh-integration-testing.iam.gserviceaccount.com
- name: Install gcloud CLI tool
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
with:
version: '>= 397.0.0'
- name: Install remote server deploy dependencies
shell: bash
run: |
sudo apt-get install -y curl sshpass xz-utils
MUSL_CROSS_TARGET="x86_64-unknown-linux-musl"
source script/linux/configure_musl_toolchain "$MUSL_CROSS_TARGET"
MUSL_CROSS_BIN="$(dirname "$WARP_MUSL_CC")"
echo "$MUSL_CROSS_BIN" >> "$GITHUB_PATH"
rustup target add x86_64-unknown-linux-musl
- name: Deploy remote server binary to test VM
run: script/deploy_remote_server_to_test_vm
- name: Run remote-server integration tests
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: cargo nextest run ${{ env.WORKSPACE_TEST_ARGS }} -E "package(integration) and test(/remote_server/)"
env:
WARP_SHELL_PATH: ${{ steps.echo_bash.outputs.default_bash_path }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload results of remote-server integration tests to trunk.io
if: ${{ !cancelled() }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
with:
junit-paths: target/nextest/ci/junit.xml
cli-version: 0.12.5
org-slug: warp
token: ${{ secrets.TRUNK_API_TOKEN }}
tags: type=integration,category=remote-server
variant: linux
use-cache: true
database-migration:
name: Database Migration (Diesel)
timeout-minutes: 5
runs-on: ubuntu-latest
needs: params
if: ${{ needs.params.outputs.affects-database-schema == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install cargo-binstall
run: ./script/install_cargo_binstall
- name: Install diesel_cli
run: |
cargo binstall diesel_cli
- name: Run all migrations on empty file
run: |
cp crates/persistence/src/schema.rs old-schema.rs
diesel migration run --database-url="test.sqlite" --migration-dir="crates/persistence/migrations"
- name: Regenerate schema and check if it is consistent with the schema at HEAD
shell: bash
run: |
diff -u old-schema.rs <(diesel print-schema --database-url="test.sqlite")
lints:
name: Formatting + Clippy (${{ matrix.name }})
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: "macos"
name: "MacOS"
runner: ${{ fromJSON(needs.params.outputs.macos-runner) }}
is_self_hosted: ${{ contains(fromJSON(needs.params.outputs.macos-runner), 'self-hosted') }}
null_device: "/dev/null"
clippy_excludes: "--exclude warp_completer"
- os: "linux"
name: "Linux"
# Use a larger (16 core, 64GB ram) runner on Linux to speed up execution time.
# https://github.com/warpdotdev/warp-internal/settings/actions/runners
runner: ubuntu-latest-large
# We don't (yet) have any self-hosted Linux runners.
is_self_hosted: false
null_device: "/dev/null"
clippy_excludes: "--exclude warp_completer"
- os: "windows"
name: "Windows"
runner: windows-latest-large
# We don't (yet) have any self-hosted Windows runners.
is_self_hosted: false
null_device: "NUL"
clippy_excludes: "--exclude warp_js --exclude command-signatures-v2"
runs-on: ${{ matrix.runner }}
needs: params
# if: ${{ needs.params.outputs.affects-rust-sources == 'true' }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/prepare_environment
with:
target_os: ${{ matrix.os }}
is_self_hosted: ${{ matrix.is_self_hosted }}
- name: Ensure cargo.lock is up-to-date
run:
cargo metadata --locked --format-version=1 > ${{ matrix.null_device }} || (echo "::error::Cargo.lock is out-of-date with Cargo.toml. Run 'cargo check' to update." && exit 1)
- name: Run ./script/format
shell: bash
run: ./script/format --check
- name: Run cargo clippy
shell: bash
run: |
set -e
# On Windows, omit --all-features because pprof and related profiling features don't compile.
if [ "${{ matrix.os }}" = "windows" ]; then
cargo clippy --locked --workspace ${{ matrix.clippy_excludes }} --all-targets --tests -- -D warnings
else
# TODO(vorporeal): Re-enable the `all-features` flag once we've fixed things.
cargo clippy --locked --workspace ${{ matrix.clippy_excludes }} --all-targets --tests -- -D warnings
# Run clippy on warp_completer with default, rather than all features enabled, because there is
# feature-gated logic for the WIP completions-on-js implementation.
cargo clippy --locked -p warp_completer --all-targets --tests -- -D warnings
fi
# Workspace feature unification enables `warp/tui` through the `warp_tui` package.
# Also lint the default GUI configuration used by `cargo run` and `./script/run`.
cargo clippy --locked -p warp --all-targets --tests -- -D warnings
env:
# Attach the GitHub auth token so that requests to the GitHub API
# don't get rate limited during compilation (e.g.: retrieving
# Sentry SDK binary releases).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run clang-format
if: ${{ matrix.os == 'macos' }}
run: |
if [[ ! -d $(brew --prefix clang-format) ]]; then
brew install clang-format
fi
./script/run-clang-format.py -r --extensions 'c,h,cpp,m' ./crates/warpui/src/ ./app/src/
general-lint:
name: Miscellaneous checks
timeout-minutes: 10
strategy:
fail-fast: false
runs-on: ubuntu-latest
needs: params
steps:
- name: Checkout sources
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
# Only cache runs on the master branch (caches on feature branches
# are not reusable).
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Install cargo-binstall
run: ./script/install_cargo_binstall
- name: Check licenses for dependencies
run: |
cargo binstall --force -y cargo-deny
# Make sure all of our dependencies use licenses that are compatible with
# our usage.
cargo deny -L error check licenses
- name: Check deny.toml / about.toml license sync
run: ./script/check_license_config_sync
- name: Run WGSL formatter
run: |
# note: this matches the version used in script/install_cargo_test_deps...
# if changing here, probably a good idea to change there too to keep dev tools on local ~= CI
cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer --tag "2025-06-28" wgslfmt && \
find . -name "*.wgsl" -exec wgslfmt --check {} +
- name: Run PSScriptAnalyzer (PowerShell Lint)
run: ./script/lint_powershell -ci
shell: pwsh
- name: Validate repo-sync markers
uses: warpdotdev/repo-sync/actions/validate-markers@main
- name: Check for incorrectly named test files
run: |
# Test files should end in _tests.rs, not _test.rs.
bad_files=$(find . -name '*_test.rs')
if [ -n "$bad_files" ]; then
while IFS= read -r f; do
echo "::error file=$f::Test file should be named ${f/_test.rs/_tests.rs} (use _tests.rs, not _test.rs)"
done <<< "$bad_files"
exit 1
fi
- name: Check for inline Rust test modules
run: ./script/check_no_inline_test_modules
wasm-lint:
name: Formatting + Clippy (wasm)
timeout-minutes: 20
strategy:
fail-fast: false
runs-on: ${{ fromJSON(needs.params.outputs.wasm-runner) }}
needs: params
steps:
- name: Compute IS_SELF_HOSTED
id: is_self_hosted
run: |
IS_SELF_HOSTED="${{ contains(fromJSON(needs.params.outputs.wasm-runner), 'self-hosted') }}"
echo "value=$IS_SELF_HOSTED" >> $GITHUB_OUTPUT
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/prepare_environment
with:
target_os: wasm
is_self_hosted: ${{ steps.is_self_hosted.outputs.value }}
- name: Ensure cargo.lock is up-to-date
run:
cargo metadata --locked --format-version=1 >/dev/null || (echo "::error::Cargo.lock is out-of-date with Cargo.toml. Run 'cargo check' to update." && exit 1)
- name: Check Rust formatting
shell: bash
run: |
# TODO(vorporeal): Once people have gotten used to ./script/format, in a week or so,
# we can have CI enforce the new formatting.
#./script/format --check
# Until then, we'll keep running the traditional formatting check.
cargo fmt --check
- name: Run cargo clippy
run: |
cargo clippy --locked --target wasm32-unknown-unknown --profile release-wasm-debug_assertions -- -D warnings
check-release-compilation:
name: Verify compilation with release flags (${{ matrix.name }})
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- os: "macos"
name: "MacOS"
runner: ${{ fromJSON(needs.params.outputs.macos-runner) }}
is_self_hosted: ${{ contains(fromJSON(needs.params.outputs.macos-runner), 'self-hosted') }}
null_device: "/dev/null"
- os: "linux"
name: "Linux"
# Use a larger (16 core, 64GB ram) runner on Linux to speed up execution time.
# https://github.com/warpdotdev/warp-internal/settings/actions/runners
runner: ubuntu-latest-large
# We don't (yet) have any self-hosted Linux runners.
is_self_hosted: false
null_device: "/dev/null"
- os: "windows"
name: "Windows"
runner: windows-latest-large
# We don't (yet) have any self-hosted Windows runners.
is_self_hosted: false
null_device: "NUL"
- os: "wasm"
name: "wasm"
runner: ${{ fromJSON(needs.params.outputs.wasm-runner) }}
is_self_hosted: ${{ contains(fromJSON(needs.params.outputs.wasm-runner), 'self-hosted') }}
null_device: "/dev/null"
runs-on: ${{ matrix.runner }}
needs: params
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/prepare_environment
with:
target_os: ${{ matrix.os }}
is_self_hosted: ${{ matrix.is_self_hosted }}
- name: Verify compilation with release flags
shell: bash
run: |
if ${{ matrix.os == 'wasm' }}; then
./script/wasm/bundle --channel oss --nouniversal --check-only
else
./script/bundle --channel oss --nouniversal --check-only
fi
env:
# Attach the GitHub auth token so that requests to the GitHub API
# don't get rate limited during compilation (e.g.: retrieving
# Sentry SDK binary releases).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The agent-mode-evals repo (warpdotdev/agent-mode-evals) depends on this repo
# with the `agent_mode_evals` feature enabled. That feature is not part of any
# other CI job's feature set, so code behind `cfg(feature = "agent_mode_evals")`
# can silently stop compiling until the eval repo bumps its pinned warp rev.
# This job compiles that configuration to catch breakage in the PR that causes it.
check-eval-compilation:
name: Verify compilation with eval features
timeout-minutes: 25
# Match the platform used by agent-mode-evals CI.
runs-on: ubuntu-latest-large
needs: params
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/prepare_environment
with:
target_os: linux
is_self_hosted: false
- name: Verify compilation with the agent_mode_evals feature
run: cargo check --locked -p warp --lib --features agent_mode_evals
env:
# Attach the GitHub auth token so that requests to the GitHub API
# don't get rate limited during compilation (e.g.: retrieving
# Sentry SDK binary releases).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# A final job that collects the results of all of the parallel CI jobs and
# makes sure that all of them pass.
#
# This allows us to tell GitHub that the only required check is this "gather"
# job, simplifying the process of adding and removing jobs to the CI
# workflow.
ci-result:
name: Check CI results
timeout-minutes: 3
runs-on: ubuntu-latest
# Always run this job, as it needs to check the results of all of the other
# jobs. If we skipped CI checks (e.g. on a draft PR), also skip this one.
if: ${{ !cancelled() && needs.params.result != 'skipped' }}
needs:
- params
- database-migration
- tests
- lints
- wasm-lint
- general-lint
- check-release-compilation
- check-eval-compilation
steps:
- name: Check CI results
run: |
# Convert needs context to JSON and check required jobs
echo '${{ toJSON(needs) }}' | jq -r '
# Get all jobs except database-migration
to_entries |
map(select(.key != "database-migration")) |
.[] |
if .value.result != "success" then
"::error::Required job \(.key) failed or was skipped (status: \(.value.result))"
else
empty
end
' | {
if read -r error; then
echo "$error"
exit 1
fi
}
# Special handling for conditional database-migration job.
affects_schema="${{ needs.params.outputs.affects-database-schema }}"
migration_result="${{ needs.database-migration.result }}"
if [[ "$affects_schema" == "true" && "$migration_result" != "success" ]]; then
echo "::error::Database migration job failed or was skipped when it should have run (status: $migration_result)"
exit 1
elif [[ "$affects_schema" != "true" && "$migration_result" != "skipped" ]]; then
echo "::error::Database migration job should have been skipped but wasn't (status: $migration_result)"
exit 1
fi
echo "All jobs completed successfully!"