forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
1718 lines (1571 loc) · 70.3 KB
/
test.yaml
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
# GENERATED, DO NOT EDIT!
# To change, edit `src/python/pants_release/generate_github_workflows.py` and run:
# ./pants run src/python/pants_release/generate_github_workflows.py
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
env:
PANTS_CONFIG_FILES: +['pants.ci.toml']
RUST_BACKTRACE: all
jobs:
bootstrap_pants_linux_arm64:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Bootstrap Pants, test Rust (Linux-ARM64)
needs:
- classify_changes
runs-on:
- self-hosted
- Linux
- ARM64
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Set rustup profile
run: rustup set profile default
- name: Cache Rust toolchain
uses: actions/cache@v3
with:
key: Linux-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
~/.rustup/update-hashes
~/.rustup/settings.toml
'
- name: Cache Cargo
uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
with:
cache-bin: 'false'
shared-key: engine
workspaces: src/rust/engine
- id: get-engine-hash
name: Get native engine hash
run: echo "hash=$(./build-support/bin/rust/print_engine_hash.sh)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache native engine
uses: actions/cache@v3
with:
key: Linux-ARM64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1
path: 'src/python/pants/bin/native_client
src/python/pants/engine/internals/native_engine.so
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: ./pants version > ${{ runner.temp }}/_pants_version.stdout && [[ -s ${{ runner.temp }}/_pants_version.stdout ]]
- name: Run smoke tests
run: './pants list ::
./pants roots
./pants help goals
./pants help targets
./pants help subsystems
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-bootstrap-Linux-ARM64
path: .pants.d/workdir/*.log
- name: Upload native binaries
uses: actions/upload-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-ARM64
path: 'src/python/pants/bin/native_client
src/python/pants/engine/internals/native_engine.so
src/python/pants/engine/internals/native_engine.so.metadata'
- env:
TMPDIR: ${{ runner.temp }}
if: needs.classify_changes.outputs.rust == 'true'
name: Test Rust
run: ./cargo test --locked --tests -- --nocapture --test-threads=8
timeout-minutes: 60
bootstrap_pants_linux_x86_64:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Bootstrap Pants, test and lint Rust (Linux-x86_64)
needs:
- classify_changes
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Set rustup profile
run: rustup set profile default
- name: Cache Rust toolchain
uses: actions/cache@v3
with:
key: Linux-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
~/.rustup/update-hashes
~/.rustup/settings.toml
'
- name: Cache Cargo
uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
with:
cache-bin: 'false'
shared-key: engine
workspaces: src/rust/engine
- id: get-engine-hash
name: Get native engine hash
run: echo "hash=$(./build-support/bin/rust/print_engine_hash.sh)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache native engine
uses: actions/cache@v3
with:
key: Linux-x86_64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1
path: 'src/python/pants/bin/native_client
src/python/pants/engine/internals/native_engine.so
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: ./pants version > ${{ runner.temp }}/_pants_version.stdout && [[ -s ${{ runner.temp }}/_pants_version.stdout ]]
- name: Run smoke tests
run: './pants list ::
./pants roots
./pants help goals
./pants help targets
./pants help subsystems
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-bootstrap-Linux-x86_64
path: .pants.d/workdir/*.log
- name: Upload native binaries
uses: actions/upload-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-x86_64
path: 'src/python/pants/bin/native_client
src/python/pants/engine/internals/native_engine.so
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Validate CI config
run: './pants run src/python/pants_release/generate_github_workflows.py -- --check
'
- env:
TMPDIR: ${{ runner.temp }}
if: needs.classify_changes.outputs.rust == 'true'
name: Test and lint Rust
run: 'sudo apt-get install -y pkg-config fuse libfuse-dev
./build-support/bin/check_rust_pre_commit.sh
./cargo test --locked --all --tests --benches -- --nocapture
./cargo doc'
timeout-minutes: 60
bootstrap_pants_macos11_x86_64:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Bootstrap Pants, test Rust (macOS11-x86_64)
needs:
- classify_changes
runs-on:
- macos-11
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Set rustup profile
run: rustup set profile default
- name: Cache Rust toolchain
uses: actions/cache@v3
with:
key: macOS11-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
~/.rustup/update-hashes
~/.rustup/settings.toml
'
- name: Cache Cargo
uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
with:
cache-bin: 'false'
shared-key: engine
workspaces: src/rust/engine
- id: get-engine-hash
name: Get native engine hash
run: echo "hash=$(./build-support/bin/rust/print_engine_hash.sh)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache native engine
uses: actions/cache@v3
with:
key: macOS11-x86_64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1
path: 'src/python/pants/bin/native_client
src/python/pants/engine/internals/native_engine.so
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: ./pants version > ${{ runner.temp }}/_pants_version.stdout && [[ -s ${{ runner.temp }}/_pants_version.stdout ]]
- name: Run smoke tests
run: './pants list ::
./pants roots
./pants help goals
./pants help targets
./pants help subsystems
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-bootstrap-macOS11-x86_64
path: .pants.d/workdir/*.log
- name: Upload native binaries
uses: actions/upload-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.macOS11-x86_64
path: 'src/python/pants/bin/native_client
src/python/pants/engine/internals/native_engine.so
src/python/pants/engine/internals/native_engine.so.metadata'
- env:
TMPDIR: ${{ runner.temp }}
if: needs.classify_changes.outputs.rust == 'true'
name: Test Rust
run: ./cargo test --locked --tests -- --nocapture
timeout-minutes: 60
build_wheels_linux_arm64:
container:
image: ghcr.io/pantsbuild/wheel_build_aarch64:v3-8384c5cf
env:
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (Linux-ARM64)
needs:
- classify_changes
runs-on:
- self-hosted
- Linux
- ARM64
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Configure Git
run: git config --global safe.directory "$GITHUB_WORKSPACE"
- name: Install rustup
run: 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -v -y --default-toolchain none
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
'
- name: Expose Pythons
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
echo "/opt/python/cp38-cp38/bin" >> $GITHUB_PATH
echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
'
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- env:
PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-wheels-and-pex-Linux-ARM64
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_linux_x86_64:
container:
image: quay.io/pypa/manylinux2014_x86_64:latest
env:
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (Linux-x86_64)
needs:
- classify_changes
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Configure Git
run: git config --global safe.directory "$GITHUB_WORKSPACE"
- name: Install rustup
run: 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -v -y --default-toolchain none
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
'
- name: Expose Pythons
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
echo "/opt/python/cp38-cp38/bin" >> $GITHUB_PATH
echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
'
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- env:
PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-wheels-and-pex-Linux-x86_64
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_macos10_15_x86_64:
env:
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (macOS10-15-x86_64)
needs:
- classify_changes
runs-on:
- self-hosted
- macOS-10.15-X64
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Set rustup profile
run: rustup set profile default
- name: Cache Rust toolchain
uses: actions/cache@v3
with:
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
~/.rustup/update-hashes
~/.rustup/settings.toml
'
- name: Cache Cargo
uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
with:
cache-bin: 'false'
shared-key: engine
workspaces: src/rust/engine
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch x86_64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch x86_64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-wheels-and-pex-macOS10-15-x86_64
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_macos11_arm64:
env:
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (macOS11-ARM64)
needs:
- classify_changes
runs-on:
- self-hosted
- macOS-11-ARM64
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Set rustup profile
run: rustup set profile default
- name: Cache Rust toolchain
uses: actions/cache@v3
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
~/.rustup/update-hashes
~/.rustup/settings.toml
'
- name: Cache Cargo
uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
with:
cache-bin: 'false'
shared-key: engine
workspaces: src/rust/engine
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 23.x
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch arm64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch arm64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-wheels-and-pex-macOS11-ARM64
path: .pants.d/workdir/*.log
timeout-minutes: 90
check_labels:
if: github.repository_owner == 'pantsbuild'
name: Ensure PR has a category label
runs-on:
- ubuntu-20.04
steps:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'pull_request'
name: Ensure category label
uses: mheap/github-action-required-labels@v4.0.0
with:
count: 1
labels: category:new feature, category:user api change, category:plugin api change, category:performance, category:bugfix,
category:documentation, category:internal
mode: exactly
classify_changes:
if: github.repository_owner == 'pantsbuild'
name: Classify changes
outputs:
ci_config: ${{ steps.classify.outputs.ci_config }}
docs: ${{ steps.classify.outputs.docs }}
docs_only: ${{ steps.classify.outputs.docs_only }}
other: ${{ steps.classify.outputs.other }}
release: ${{ steps.classify.outputs.release }}
rust: ${{ steps.classify.outputs.rust }}
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- id: classify
name: Classify changed files
run: "if [[ -z $GITHUB_EVENT_PULL_REQUEST_BASE_SHA ]]; then\n # push: compare to the immediate parent, which should\
\ already be fetched\n # (checkout's fetch_depth defaults to 10)\n comparison_sha=$(git rev-parse HEAD^)\nelse\n\
\ # pull request: compare to the base branch, ensuring that commit exists\n git fetch --depth=1 \"$GITHUB_EVENT_PULL_REQUEST_BASE_SHA\"\
\n comparison_sha=\"$GITHUB_EVENT_PULL_REQUEST_BASE_SHA\"\nfi\necho \"comparison_sha=$comparison_sha\"\n\naffected=$(git\
\ diff --name-only \"$comparison_sha\" HEAD | python build-support/bin/classify_changed_files.py)\necho \"Affected:\"\
\nif [[ \"${affected}\" == \"docs\" ]]; then\n echo \"docs_only=true\" | tee -a $GITHUB_OUTPUT\nfi\nfor i in ${affected};\
\ do\n echo \"${i}=true\" | tee -a $GITHUB_OUTPUT\ndone\n"
lint_python:
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Lint Python and Shell
needs:
- bootstrap_pants_linux_x86_64
- classify_changes
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
name: Launch bazel-remote
run: "mkdir -p ~/bazel-remote\nif [[ -z \"${AWS_ACCESS_KEY_ID}\" ]]; then\n CACHE_WRITE=false\n # If no secret read/write\
\ creds, use hard-coded read-only creds, so that\n # cross-fork PRs can at least read from the cache.\n # These\
\ creds are hard-coded here in this public repo, which makes the bucket\n # world-readable. But since putting raw\
\ AWS tokens in a public repo, even\n # deliberately, is icky, we base64-them. This will at least help hide from\n\
\ # automated scanners that look for checked in AWS keys.\n # Not that it would be terrible if we were scanned,\
\ since this is public\n # on purpose, but it's best not to draw attention.\n AWS_ACCESS_KEY_ID=$(echo 'QUtJQVY2QTZHN1JRVkJJUVM1RUEK'\
\ | base64 -d)\n AWS_SECRET_ACCESS_KEY=$(echo 'd3dOQ1k1eHJJWVVtejZBblV6M0l1endXV0loQWZWcW9GZlVjMDlKRwo=' | base64\
\ -d)\nelse\n CACHE_WRITE=true\nfi\ndocker run --detach -u 1001:1000 -v ~/bazel-remote:/data \
\ -p 9092:9092 buchgr/bazel-remote-cache:v2.4.1 --s3.auth_method=access_key\
\ --s3.access_key_id=\"${AWS_ACCESS_KEY_ID}\" --s3.secret_access_key=\"${AWS_SECRET_ACCESS_KEY}\"\
\ --s3.bucket=cache.pantsbuild.org --s3.endpoint=s3.us-east-1.amazonaws.com \
\ --max_size 30\necho \"PANTS_REMOTE_STORE_ADDRESS=grpc://localhost:9092\" >> \"$GITHUB_ENV\"\necho\
\ \"PANTS_REMOTE_CACHE_READ=true\" >> \"$GITHUB_ENV\"\necho \"PANTS_REMOTE_CACHE_WRITE=${CACHE_WRITE}\" >> \"$GITHUB_ENV\"\
\n"
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Download native binaries
uses: actions/download-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-x86_64
path: src/python/pants
- name: Make native-client runnable
run: chmod +x src/python/pants/bin/native_client
- name: Lint
run: './pants lint check ::
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-lint-Linux-x86_64
path: .pants.d/workdir/*.log
timeout-minutes: 30
merge_ok:
if: always()
name: Merge OK
needs:
- set_merge_ok
runs-on:
- ubuntu-20.04
steps:
- run: "merge_ok=\"${{ needs.set_merge_ok.outputs.merge_ok }}\"\nif [[ \"${merge_ok}\" == \"true\" ]]; then\n echo\
\ \"Merge OK\"\n exit 0\nelse\n echo \"Merge NOT OK\"\n exit 1\nfi\n"
set_merge_ok:
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
name: Set Merge OK
needs:
- classify_changes
- check_labels
- bootstrap_pants_linux_arm64
- bootstrap_pants_linux_x86_64
- bootstrap_pants_macos11_x86_64
- build_wheels_linux_arm64
- build_wheels_linux_x86_64
- build_wheels_macos10_15_x86_64
- build_wheels_macos11_arm64
- check_labels
- classify_changes
- lint_python
- test_python_linux_arm64
- test_python_linux_x86_64_0
- test_python_linux_x86_64_1
- test_python_linux_x86_64_2
- test_python_linux_x86_64_3
- test_python_linux_x86_64_4
- test_python_linux_x86_64_5
- test_python_linux_x86_64_6
- test_python_linux_x86_64_7
- test_python_linux_x86_64_8
- test_python_linux_x86_64_9
- test_python_macos11_x86_64
outputs:
merge_ok: ${{ steps.set_merge_ok.outputs.merge_ok }}
runs-on:
- ubuntu-20.04
steps:
- id: set_merge_ok
run: echo 'merge_ok=true' >> ${GITHUB_OUTPUT}
test_python_linux_arm64:
env:
PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Test Python (Linux-ARM64)
needs:
- bootstrap_pants_linux_arm64
- classify_changes
runs-on:
- self-hosted
- Linux
- ARM64
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '11'
- name: Download native binaries
uses: actions/download-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-ARM64
path: src/python/pants
- name: Make native-client runnable
run: chmod +x src/python/pants/bin/native_client
- name: Run Python tests
run: './pants --tag=+platform_specific_behavior test :: -- -m platform_specific_behavior
'
- continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: always()
name: Upload test reports
run: 'export S3_DST=s3://logs.pantsbuild.org/test/reports/Linux-ARM64/$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)/${GITHUB_REF_NAME//\//_}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/${GITHUB_JOB}
echo "Uploading test reports to ${S3_DST}"
./pants run ./src/python/pants_release/copy_to_s3.py -- --src-prefix=dist/test/reports --dst-prefix=${S3_DST} --path=""
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-python-test-Linux-ARM64
path: .pants.d/workdir/*.log
timeout-minutes: 90
test_python_linux_x86_64_0:
env:
PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Test Python (Linux-x86_64) Shard 0/10
needs:
- bootstrap_pants_linux_x86_64
- classify_changes
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
name: Launch bazel-remote
run: "mkdir -p ~/bazel-remote\nif [[ -z \"${AWS_ACCESS_KEY_ID}\" ]]; then\n CACHE_WRITE=false\n # If no secret read/write\
\ creds, use hard-coded read-only creds, so that\n # cross-fork PRs can at least read from the cache.\n # These\
\ creds are hard-coded here in this public repo, which makes the bucket\n # world-readable. But since putting raw\
\ AWS tokens in a public repo, even\n # deliberately, is icky, we base64-them. This will at least help hide from\n\
\ # automated scanners that look for checked in AWS keys.\n # Not that it would be terrible if we were scanned,\
\ since this is public\n # on purpose, but it's best not to draw attention.\n AWS_ACCESS_KEY_ID=$(echo 'QUtJQVY2QTZHN1JRVkJJUVM1RUEK'\
\ | base64 -d)\n AWS_SECRET_ACCESS_KEY=$(echo 'd3dOQ1k1eHJJWVVtejZBblV6M0l1endXV0loQWZWcW9GZlVjMDlKRwo=' | base64\
\ -d)\nelse\n CACHE_WRITE=true\nfi\ndocker run --detach -u 1001:1000 -v ~/bazel-remote:/data \
\ -p 9092:9092 buchgr/bazel-remote-cache:v2.4.1 --s3.auth_method=access_key\
\ --s3.access_key_id=\"${AWS_ACCESS_KEY_ID}\" --s3.secret_access_key=\"${AWS_SECRET_ACCESS_KEY}\"\
\ --s3.bucket=cache.pantsbuild.org --s3.endpoint=s3.us-east-1.amazonaws.com \
\ --max_size 30\necho \"PANTS_REMOTE_STORE_ADDRESS=grpc://localhost:9092\" >> \"$GITHUB_ENV\"\necho\
\ \"PANTS_REMOTE_CACHE_READ=true\" >> \"$GITHUB_ENV\"\necho \"PANTS_REMOTE_CACHE_WRITE=${CACHE_WRITE}\" >> \"$GITHUB_ENV\"\
\n"
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '11'
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift -o "${HOME}/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Expose Pythons
uses: pantsbuild/actions/expose-pythons@627a8ce25d972afa03da1641be9261bbbe0e3ffe
- name: Download native binaries
uses: actions/download-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-x86_64
path: src/python/pants
- name: Make native-client runnable
run: chmod +x src/python/pants/bin/native_client
- name: Run Python test shard 0/10
run: './pants test --shard=0/10 ::
'
- continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: always()
name: Upload test reports
run: 'export S3_DST=s3://logs.pantsbuild.org/test/reports/Linux-x86_64/$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)/${GITHUB_REF_NAME//\//_}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/${GITHUB_JOB}
echo "Uploading test reports to ${S3_DST}"
./pants run ./src/python/pants_release/copy_to_s3.py -- --src-prefix=dist/test/reports --dst-prefix=${S3_DST} --path=""
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-python-test-0_10-Linux-x86_64
path: .pants.d/workdir/*.log
timeout-minutes: 90
test_python_linux_x86_64_1:
env:
PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Test Python (Linux-x86_64) Shard 1/10
needs:
- bootstrap_pants_linux_x86_64
- classify_changes
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
name: Launch bazel-remote
run: "mkdir -p ~/bazel-remote\nif [[ -z \"${AWS_ACCESS_KEY_ID}\" ]]; then\n CACHE_WRITE=false\n # If no secret read/write\
\ creds, use hard-coded read-only creds, so that\n # cross-fork PRs can at least read from the cache.\n # These\
\ creds are hard-coded here in this public repo, which makes the bucket\n # world-readable. But since putting raw\
\ AWS tokens in a public repo, even\n # deliberately, is icky, we base64-them. This will at least help hide from\n\
\ # automated scanners that look for checked in AWS keys.\n # Not that it would be terrible if we were scanned,\
\ since this is public\n # on purpose, but it's best not to draw attention.\n AWS_ACCESS_KEY_ID=$(echo 'QUtJQVY2QTZHN1JRVkJJUVM1RUEK'\
\ | base64 -d)\n AWS_SECRET_ACCESS_KEY=$(echo 'd3dOQ1k1eHJJWVVtejZBblV6M0l1endXV0loQWZWcW9GZlVjMDlKRwo=' | base64\
\ -d)\nelse\n CACHE_WRITE=true\nfi\ndocker run --detach -u 1001:1000 -v ~/bazel-remote:/data \
\ -p 9092:9092 buchgr/bazel-remote-cache:v2.4.1 --s3.auth_method=access_key\
\ --s3.access_key_id=\"${AWS_ACCESS_KEY_ID}\" --s3.secret_access_key=\"${AWS_SECRET_ACCESS_KEY}\"\
\ --s3.bucket=cache.pantsbuild.org --s3.endpoint=s3.us-east-1.amazonaws.com \
\ --max_size 30\necho \"PANTS_REMOTE_STORE_ADDRESS=grpc://localhost:9092\" >> \"$GITHUB_ENV\"\necho\
\ \"PANTS_REMOTE_CACHE_READ=true\" >> \"$GITHUB_ENV\"\necho \"PANTS_REMOTE_CACHE_WRITE=${CACHE_WRITE}\" >> \"$GITHUB_ENV\"\
\n"
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '11'
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift -o "${HOME}/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Expose Pythons
uses: pantsbuild/actions/expose-pythons@627a8ce25d972afa03da1641be9261bbbe0e3ffe
- name: Download native binaries
uses: actions/download-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-x86_64
path: src/python/pants
- name: Make native-client runnable
run: chmod +x src/python/pants/bin/native_client
- name: Run Python test shard 1/10
run: './pants test --shard=1/10 ::
'
- continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: always()
name: Upload test reports
run: 'export S3_DST=s3://logs.pantsbuild.org/test/reports/Linux-x86_64/$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)/${GITHUB_REF_NAME//\//_}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/${GITHUB_JOB}
echo "Uploading test reports to ${S3_DST}"
./pants run ./src/python/pants_release/copy_to_s3.py -- --src-prefix=dist/test/reports --dst-prefix=${S3_DST} --path=""
'
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v3
with:
name: logs-python-test-1_10-Linux-x86_64
path: .pants.d/workdir/*.log
timeout-minutes: 90
test_python_linux_x86_64_2:
env:
PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Test Python (Linux-x86_64) Shard 2/10
needs:
- bootstrap_pants_linux_x86_64
- classify_changes
runs-on:
- ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 10
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
name: Launch bazel-remote
run: "mkdir -p ~/bazel-remote\nif [[ -z \"${AWS_ACCESS_KEY_ID}\" ]]; then\n CACHE_WRITE=false\n # If no secret read/write\
\ creds, use hard-coded read-only creds, so that\n # cross-fork PRs can at least read from the cache.\n # These\
\ creds are hard-coded here in this public repo, which makes the bucket\n # world-readable. But since putting raw\
\ AWS tokens in a public repo, even\n # deliberately, is icky, we base64-them. This will at least help hide from\n\
\ # automated scanners that look for checked in AWS keys.\n # Not that it would be terrible if we were scanned,\
\ since this is public\n # on purpose, but it's best not to draw attention.\n AWS_ACCESS_KEY_ID=$(echo 'QUtJQVY2QTZHN1JRVkJJUVM1RUEK'\
\ | base64 -d)\n AWS_SECRET_ACCESS_KEY=$(echo 'd3dOQ1k1eHJJWVVtejZBblV6M0l1endXV0loQWZWcW9GZlVjMDlKRwo=' | base64\
\ -d)\nelse\n CACHE_WRITE=true\nfi\ndocker run --detach -u 1001:1000 -v ~/bazel-remote:/data \
\ -p 9092:9092 buchgr/bazel-remote-cache:v2.4.1 --s3.auth_method=access_key\
\ --s3.access_key_id=\"${AWS_ACCESS_KEY_ID}\" --s3.secret_access_key=\"${AWS_SECRET_ACCESS_KEY}\"\
\ --s3.bucket=cache.pantsbuild.org --s3.endpoint=s3.us-east-1.amazonaws.com \
\ --max_size 30\necho \"PANTS_REMOTE_STORE_ADDRESS=grpc://localhost:9092\" >> \"$GITHUB_ENV\"\necho\
\ \"PANTS_REMOTE_CACHE_READ=true\" >> \"$GITHUB_ENV\"\necho \"PANTS_REMOTE_CACHE_WRITE=${CACHE_WRITE}\" >> \"$GITHUB_ENV\"\
\n"
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: '11'
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift -o "${HOME}/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Expose Pythons
uses: pantsbuild/actions/expose-pythons@627a8ce25d972afa03da1641be9261bbbe0e3ffe
- name: Download native binaries
uses: actions/download-artifact@v3
with:
name: native_binaries.${{ matrix.python-version }}.Linux-x86_64
path: src/python/pants
- name: Make native-client runnable
run: chmod +x src/python/pants/bin/native_client
- name: Run Python test shard 2/10
run: './pants test --shard=2/10 ::
'
- continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: always()