11
11
required : true
12
12
type : string
13
13
14
+ build_matrix :
15
+ required : true
16
+ type : string
17
+
14
18
host_matrix :
15
19
required : true
16
20
type : string
@@ -541,17 +545,19 @@ jobs:
541
545
path : ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-${{ inputs.swift_cmark_version }}/usr
542
546
543
547
build_tools :
544
- # TODO: Build this on macOS or make an equivalent Mac-only job
545
- if : inputs.build_os == 'Windows'
546
548
needs : [cmark_gfm]
547
549
runs-on : ${{ inputs.default_build_runner }}
548
550
549
- name : Windows amd64 Compiler Build Tools
551
+ strategy :
552
+ fail-fast : false
553
+ matrix : ${{ fromJSON(inputs.build_matrix) }}
554
+
555
+ name : ${{ matrix.os }} ${{ matrix.arch }} Compiler Build Tools
550
556
551
557
steps :
552
558
- uses : actions/download-artifact@v4
553
559
with :
554
- name : cmark-gfm-Windows-amd64 -${{ inputs.swift_cmark_version }}
560
+ name : cmark-gfm-${{ matrix.os }}-${{ matrix.arch }} -${{ inputs.swift_cmark_version }}
555
561
path : ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-${{ inputs.swift_cmark_version }}/usr
556
562
557
563
- uses : actions/checkout@v4
@@ -569,9 +575,11 @@ jobs:
569
575
570
576
- uses : compnerd/gha-setup-vsdevenv@main
571
577
578
+ - uses : seanmiddleditch/gha-setup-ninja@master
579
+ if : inputs.build_os == 'Darwin'
580
+
572
581
- name : Compute workspace hash
573
582
id : workspace_hash
574
- shell : pwsh
575
583
run : |
576
584
$stringAsStream = [System.IO.MemoryStream]::new()
577
585
$writer = [System.IO.StreamWriter]::new($stringAsStream)
@@ -585,19 +593,19 @@ jobs:
585
593
uses : hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
586
594
with :
587
595
max-size : 100M
588
- key : ${{ steps.workspace_hash.outputs.hash }}-windows-amd64 -build_tools
596
+ key : ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }} -build_tools
589
597
variant : sccache
590
598
591
599
- name : Configure Tools
592
600
run : |
593
601
cmake -B ${{ github.workspace }}/BinaryCache/0 `
594
602
-D CMAKE_BUILD_TYPE=Release `
595
- -D CMAKE_C_COMPILER=cl `
603
+ -D CMAKE_C_COMPILER=${{ matrix.cc }} `
596
604
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
597
- -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" `
598
- -D CMAKE_CXX_COMPILER=cl `
605
+ -D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
606
+ -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
599
607
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
600
- -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" `
608
+ -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
601
609
-D CMAKE_MT=mt `
602
610
-D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-${{ inputs.swift_cmark_version }}/usr/lib/cmake `
603
611
-G Ninja `
@@ -644,19 +652,33 @@ jobs:
644
652
- name : Build swift-compatibility-symbols
645
653
run : cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-compatibility-symbols
646
654
655
+ - name : Export binary paths
656
+ id : export-binary-paths
657
+ run : |
658
+ $Suffix = if ( "${{ matrix.os }}" -eq "Windows" ) { ".exe" } else { "" }
659
+ echo "llvm_tblgen=${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen${Suffix}" >> $env:GITHUB_OUTPUT
660
+ echo "clang_tblgen=${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen${Suffix}" >> $env:GITHUB_OUTPUT
661
+ echo "lldb_tblgen=${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen${Suffix}" >> $env:GITHUB_OUTPUT
662
+ echo "llvm_config=${{ github.workspace }}/BinaryCache/0/bin/llvm-config${Suffix}" >> $env:GITHUB_OUTPUT
663
+ echo "clang_pseudo_gen=${{ github.workspace }}/BinaryCache/0/bin/clang-pseudo-gen${Suffix}" >> $env:GITHUB_OUTPUT
664
+ echo "clang_tidy_confusable_chars_gen=${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen${Suffix}" >> $env:GITHUB_OUTPUT
665
+ echo "swift_def_to_strings_converter=${{ github.workspace }}/BinaryCache/0/bin/swift-def-to-strings-converter${Suffix}" >> $env:GITHUB_OUTPUT
666
+ echo "swift_serialize_diagnostics=${{ github.workspace }}/BinaryCache/0/bin/swift-serialize-diagnostics${Suffix}" >> $env:GITHUB_OUTPUT
667
+ echo "swift_compatibility_symbols=${{ github.workspace }}/BinaryCache/0/bin/swift-compatibility-symbols${Suffix}" >> $env:GITHUB_OUTPUT
668
+
647
669
- uses : actions/upload-artifact@v4
648
670
with :
649
- name : build-tools
671
+ name : build-tools-${{ matrix.os }}
650
672
path : |
651
- ${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe
652
- ${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe
653
- ${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe
654
- ${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe
655
- ${{ github.workspace }}/BinaryCache/0/bin/clang-pseudo-gen.exe
656
- ${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe
657
- ${{ github.workspace }}/BinaryCache/0/bin/swift-def-to-strings-converter.exe
658
- ${{ github.workspace }}/BinaryCache/0/bin/swift-serialize-diagnostics.exe
659
- ${{ github.workspace }}/BinaryCache/0/bin/swift-compatibility-symbols.exe
673
+ ${{ steps.export-binary-paths.outputs.llvm_tblgen }}
674
+ ${{ steps.export-binary-paths.outputs.clang_tblgen }}
675
+ ${{ steps.export-binary-paths.outputs.lldb_tblgen }}
676
+ ${{ steps.export-binary-paths.outputs.llvm_config }}
677
+ ${{ steps.export-binary-paths.outputs.clang_pseudo_gen }}
678
+ ${{ steps.export-binary-paths.outputs.clang_tidy_confusable_chars_gen }}
679
+ ${{ steps.export-binary-paths.outputs.swift_def_to_strings_converter }}
680
+ ${{ steps.export-binary-paths.outputs.swift_serialize_diagnostics }}
681
+ ${{ steps.export-binary-paths.outputs.swift_compatibility_symbols }}
660
682
661
683
compilers :
662
684
# TODO: Build this on macOS or make an equivalent Mac-only job
@@ -685,7 +707,7 @@ jobs:
685
707
steps :
686
708
- uses : actions/download-artifact@v4
687
709
with :
688
- name : build-tools
710
+ name : build-tools-Windows
689
711
path : ${{ github.workspace }}/BinaryCache/0/bin
690
712
- uses : actions/download-artifact@v4
691
713
with :
0 commit comments