GHA: Add support for publishing test results #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Swift Matrix | ||
|
Check failure on line 1 in .github/workflows/swift_package_test.yml
|
||
| permissions: | ||
| contents: read | ||
| # checks: write | ||
| # pull-requests: write | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| macos_xcode_versions: | ||
| type: string | ||
| description: "Xcode version list (JSON)" | ||
| default: "[\"16.3\", \"16.4\", \"26.0\"]" | ||
| macos_exclude_xcode_versions: | ||
| type: string | ||
| description: "Exclude Xcode version list (JSON)" | ||
| default: "[{\"xcode_version\": \"\"}]" | ||
| macos_versions: | ||
| type: string | ||
| description: "macOS version list (JSON)" | ||
| default: "[\"tahoe\"]" | ||
| macos_archs: | ||
| type: string | ||
| description: "macOS arch list (JSON)" | ||
| default: "[\"ARM64\"]" | ||
| ios_host_xcode_versions: | ||
| type: string | ||
| description: "Xcode version list (JSON)" | ||
| default: null | ||
| ios_host_exclude_xcode_versions: | ||
| type: string | ||
| description: "Exclude Xcode version list (JSON)" | ||
| default: null | ||
| ios_host_versions: | ||
| type: string | ||
| description: "iOS host (macOS) version list (JSON)" | ||
| default: null | ||
| ios_host_archs: | ||
| type: string | ||
| description: "iOS host (macOS) arch list (JSON)" | ||
| default: null | ||
| linux_swift_versions: | ||
| type: string | ||
| description: "Include Linux Swift version list (JSON)" | ||
| default: "[ \"5.9\", \"5.10\", \"6.0\", \"6.1\", \"6.2\", \"nightly-main\", \"nightly-6.3\"]" | ||
| linux_exclude_swift_versions: | ||
| type: string | ||
| description: "Exclude Linux Swift version list (JSON)" | ||
| default: "[{\"swift_version\": \"\"}]" | ||
| linux_os_versions: | ||
| type: string | ||
| description: "Linux OS version list (JSON)" | ||
| default: "[\"jammy\"]" | ||
| linux_host_archs: | ||
| type: string | ||
| description: "Linux arch list (JSON)" | ||
| default: "[\"x86_64\"]" | ||
| linux_static_sdk_versions: | ||
| type: string | ||
| description: "Static Linux Swift SDK version list (JSON)" | ||
| default: "[\"nightly-main\", \"nightly-6.2\", \"6.2\"]" | ||
| linux_static_sdk_exclude_swift_versions: | ||
| type: string | ||
| description: "Exclude Static Linux Swift SDK version list (JSON)" | ||
| default: "[{\"swift_version\": \"\"}]" | ||
| wasm_sdk_versions: | ||
| type: string | ||
| description: "Wasm Swift SDK version list (JSON)" | ||
| default: "[\"nightly-main\", \"nightly-6.3\", \"6.2\"]" | ||
| wasm_exclude_swift_versions: | ||
| type: string | ||
| description: "Exclude Wasm Swift SDK version list (JSON)" | ||
| default: "[{\"swift_version\": \"\"}]" | ||
| android_sdk_versions: | ||
| type: string | ||
| description: "Android Swift SDK version list (JSON)" | ||
| default: "[\"nightly-main\", \"nightly-6.3\"]" | ||
| android_exclude_swift_versions: | ||
| type: string | ||
| description: "Exclude Android Swift SDK version list (JSON)" | ||
| default: "[{\"swift_version\": \"\"}]" | ||
| windows_swift_versions: | ||
| type: string | ||
| description: "Include Windows Swift version list (JSON)" | ||
| # "5.10" is omitted for Windows because the container image is broken. | ||
| default: "[\"5.9\", \"6.0\", \"6.1\", \"6.2\", \"nightly-main\", \"nightly-6.3\"]" | ||
| windows_exclude_swift_versions: | ||
| type: string | ||
| description: "Exclude Windows Swift version list (JSON)" | ||
| default: "[{\"swift_version\": \"\"}]" | ||
| windows_os_versions: | ||
| type: string | ||
| description: "Windows OS version label list (JSON)" | ||
| default: "[\"windows-2022\"]" | ||
| swift_flags: | ||
| type: string | ||
| description: "Swift flags for release version" | ||
| default: "" | ||
| swift_nightly_flags: | ||
| type: string | ||
| description: "Swift flags for nightly version" | ||
| default: "" | ||
| linux_pre_build_command: | ||
| type: string | ||
| description: "Linux command to execute before building the Swift package" | ||
| default: "" | ||
| linux_static_sdk_pre_build_command: | ||
| type: string | ||
| description: "Linux command to execute before building the Swift package with the Static Linux Swift SDK" | ||
| default: "" | ||
| wasm_sdk_pre_build_command: | ||
| type: string | ||
| description: "Linux command to execute before building the Swift package with the Embedded Swift SDK for Wasm" | ||
| default: "" | ||
| android_sdk_pre_build_command: | ||
| type: string | ||
| description: "Linux command to execute before building the Swift package with the Embedded Swift SDK for Android" | ||
| default: "" | ||
| macos_pre_build_command: | ||
| type: string | ||
| description: "macOS command to execute before building the Swift package" | ||
| default: "" | ||
| macos_build_command: | ||
| type: string | ||
| description: "macOS command to build and test the package" | ||
| default: "xcrun swift test" | ||
| macos_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| macos_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| macos_build_timeout: | ||
| type: number | ||
| description: "The default step timeout in minutes" | ||
| default: 60 | ||
| ios_pre_build_command: | ||
| type: string | ||
| description: "macOS command to execute before building the Swift package for iOS" | ||
| default: "" | ||
| ios_build_command: | ||
| type: string | ||
| description: "macOS command to build the package for iOS" | ||
| default: "\"$(xcrun -f swift)\" build --build-tests --sdk \"$(xcrun --sdk iphoneos --show-sdk-path)\" --triple arm64-apple-ios" | ||
| ios_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| ios_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| ios_build_timeout: | ||
| type: number | ||
| description: "The default step timeout in minutes" | ||
| default: 60 | ||
| linux_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| linux_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| linux_build_command: | ||
| type: string | ||
| description: "Linux command to build and test the package" | ||
| default: "swift test" | ||
| linux_static_sdk_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| linux_static_sdk_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| linux_static_sdk_build_command: | ||
| type: string | ||
| description: "Command to use when building the package with the Static Linux Swift SDK" | ||
| default: "swift build" | ||
| wasm_sdk_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| wasm_sdk_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| wasm_sdk_build_command: | ||
| type: string | ||
| description: "Command to use when building the package with the Swift SDK for Wasm" | ||
| default: "swift build" | ||
| android_sdk_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| android_sdk_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| android_sdk_build_command: | ||
| type: string | ||
| description: "Command to use when building the package with the Swift SDK for Android" | ||
| default: "swift build" | ||
| android_sdk_triples: | ||
| type: string | ||
| description: "The triples to use when building with the Swift SDK for Android. The final triple in the list will be used for the emulator testing and should match the host architecture." | ||
| default: "[\"aarch64-unknown-linux-android28\", \"x86_64-unknown-linux-android28\"]" | ||
| android_ndk_versions: | ||
| type: string | ||
| description: "The NDK versions to use when building with the Swift SDK for Android" | ||
| default: "[\"r27d\"]" | ||
| windows_pre_build_command: | ||
| type: string | ||
| description: "Windows Command Prompt command to execute before building the Swift package" | ||
| default: "" | ||
| windows_publish_test_results: | ||
| type: boolean | ||
| description: "Boolean to enable publishing test results" | ||
| default: false | ||
| windows_publish_test_results_files: | ||
| type: string | ||
| description: "A string representation, where each line is a relative path pattern of test results files to publish" | ||
| default: "*.xml" | ||
| windows_build_command: | ||
| type: string | ||
| description: | | ||
| Windows Command Prompt command to build and test the package. | ||
| Note that Powershell does not automatically exit if a subcommand fails. The Invoke-Program utility is available to propagate non-zero exit codes. | ||
| It is strongly encouraged to run all command using `Invoke-Program` unless you want to continue on error eg. `Invoke-Program git apply patch.diff` instead of `git apply patch.diff`. | ||
| default: "Invoke-Program swift test" | ||
| windows_build_timeout: | ||
| type: number | ||
| description: "The default step timeout in minutes" | ||
| default: 60 | ||
| macos_env_vars: | ||
| description: "Newline separated list of environment variables" | ||
| type: string | ||
| ios_host_env_vars: | ||
| description: "Newline separated list of environment variables" | ||
| type: string | ||
| linux_env_vars: | ||
| description: "Newline separated list of environment variables" | ||
| type: string | ||
| windows_env_vars: | ||
| description: "Newline separated list of environment variables" | ||
| type: string | ||
| enable_linux_checks: | ||
| type: boolean | ||
| description: "Boolean to enable linux testing. Defaults to true" | ||
| default: true | ||
| enable_linux_static_sdk_build: | ||
| type: boolean | ||
| description: "Boolean to enable building with the Static Linux Swift SDK. Defaults to false" | ||
| default: false | ||
| enable_wasm_sdk_build: | ||
| type: boolean | ||
| description: "Boolean to enable building with the Swift SDK for Wasm. Defaults to false" | ||
| default: false | ||
| enable_embedded_wasm_sdk_build: | ||
| type: boolean | ||
| description: "Boolean to enable building with the Embedded Swift SDK for Wasm. Defaults to false" | ||
| default: false | ||
| enable_android_sdk_build: | ||
| type: boolean | ||
| description: "Boolean to enable building with the Swift SDK for Android. Defaults to false" | ||
| default: false | ||
| enable_android_sdk_checks: | ||
| type: boolean | ||
| description: "Boolean to enable testing with the Swift SDK for Android. Defaults to false" | ||
| default: false | ||
| enable_macos_checks: | ||
| type: boolean | ||
| description: "Boolean to enable macOS testing. Defaults to false" | ||
| default: false | ||
| enable_ios_checks: | ||
| type: boolean | ||
| description: "Boolean to enable iOS testing. Defaults to false" | ||
| default: false | ||
| enable_windows_checks: | ||
| type: boolean | ||
| description: "Boolean to enable windows testing. Defaults to true" | ||
| default: true | ||
| enable_windows_docker: | ||
| type: boolean | ||
| description: "Boolean to enable running build in windows docker container. Defaults to true" | ||
| default: true | ||
| needs_token: | ||
| type: boolean | ||
| description: "Boolean to enable providing the GITHUB_TOKEN to downstream job." | ||
| default: false | ||
| enable_cross_pr_testing: | ||
| type: boolean | ||
| description: "Whether PRs can be tested in combination with other PRs by mentioning them as `Linked PR: <link to PR>` in the PR description" | ||
| default: false | ||
| jobs: | ||
| macos-build: | ||
| name: macOS (Xcode ${{ matrix.xcode_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }}) | ||
| if: ${{ inputs.enable_macos_checks }} | ||
| runs-on: [self-hosted, macos, "${{ matrix.os_version }}", "${{ matrix.arch }}"] | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| xcode_version: ${{ fromJson(inputs.macos_xcode_versions) }} | ||
| os_version: ${{ fromJson(inputs.macos_versions) }} | ||
| arch: ${{ fromJson(inputs.macos_archs) }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.macos_exclude_xcode_versions) }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Set environment variables | ||
| if: ${{ inputs.macos_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.macos_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Select Xcode | ||
| run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app" >> $GITHUB_ENV | ||
| - name: Swift version | ||
| run: xcrun swift --version | ||
| - name: Clang version | ||
| run: xcrun clang --version | ||
| - name: Pre-build | ||
| run: ${{ inputs.macos_pre_build_command }} | ||
| - name: "Build / Test" | ||
| run: ${{ inputs.macos_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| timeout-minutes: ${{ inputs.macos_build_timeout }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action/macos@v2.23.0 | ||
| if: ${{ inputs.macos_publish_test_results && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.macos_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.macos_publish_test_results && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.macos_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| ios-build: | ||
| name: iOS (Build Only, Xcode ${{ matrix.xcode_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }}) | ||
| if: ${{ inputs.enable_ios_checks }} | ||
| runs-on: [self-hosted, macos, "${{ matrix.os_version }}", "${{ matrix.arch }}"] | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| xcode_version: ${{ fromJson(inputs.ios_host_xcode_versions || inputs.macos_xcode_versions) }} | ||
| os_version: ${{ fromJson(inputs.ios_host_versions || inputs.macos_versions) }} | ||
| arch: ${{ fromJson(inputs.ios_host_archs || inputs.macos_archs) }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.ios_host_exclude_xcode_versions || inputs.macos_exclude_xcode_versions) }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Set environment variables | ||
| if: ${{ inputs.ios_host_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.ios_host_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Select Xcode | ||
| run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app" >> $GITHUB_ENV | ||
| - name: Swift version | ||
| run: | | ||
| "$(xcrun -f swift)" --version | ||
| - name: Pre-build | ||
| run: ${{ inputs.ios_pre_build_command }} | ||
| - name: "Build" | ||
| run: ${{ inputs.ios_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| timeout-minutes: ${{ inputs.ios_build_timeout }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action/macos@v2.23.0 | ||
| if: ${{ inputs.ios_publish_test_results && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.ios_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.ios_publish_test_results && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.ios_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| linux-build: | ||
| name: Linux (${{ matrix.swift_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }}) | ||
| if: ${{ inputs.enable_linux_checks }} | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| swift_version: ${{ fromJson(inputs.linux_swift_versions) }} | ||
| os_version: ${{ fromJson(inputs.linux_os_versions) }} | ||
| arch: ${{ fromJson(inputs.linux_host_archs) }} | ||
| runner: ${{ | ||
| fromJson( | ||
| contains(fromJson(inputs.linux_host_archs), 'x86_64') && !contains(fromJson(inputs.linux_host_archs), 'aarch64') | ||
| && '["ubuntu-24.04"]' | ||
| || contains(fromJson(inputs.linux_host_archs), 'aarch64') && !contains(fromJson(inputs.linux_host_archs), 'x86_64') | ||
| && '["ubuntu-24.04-arm"]' | ||
| || '["ubuntu-24.04","ubuntu-24.04-arm"]' | ||
| ) | ||
| }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.linux_exclude_swift_versions) }} | ||
| - arch: x86_64 | ||
| runner: ubuntu-24.04-arm | ||
| - arch: aarch64 | ||
| runner: ubuntu-24.04 | ||
| container: | ||
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | ||
| steps: | ||
| - name: Swift version | ||
| run: swift --version | ||
| - name: Clang version | ||
| run: clang --version | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| if: ${{ matrix.os_version != 'amazonlinux2' }} | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v1 | ||
| if: ${{ matrix.os_version == 'amazonlinux2' }} | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: github-workflows | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v1 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: ${{ github.event.repository.name }}/github-workflows | ||
| ref: main | ||
| - name: Determine script-root path | ||
| id: script_path | ||
| run: | | ||
| if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then | ||
| echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Check out related PRs | ||
| if: ${{ inputs.enable_cross_pr_testing && github.event_name == 'pull_request' }} | ||
| run: | | ||
| cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift | ||
| swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}" | ||
| - name: Set environment variables | ||
| if: ${{ inputs.linux_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.linux_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Pre-build | ||
| run: ${{ inputs.linux_pre_build_command }} | ||
| - name: "Build / Test" | ||
| run: ${{ inputs.linux_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action/linux@v2.23.0 | ||
| if: ${{ inputs.linux_publish_test_results && matrix.os_version != 'amazonlinux2 && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.linux_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.linux_publish_test_results && matrix.os_version != 'amazonlinux2 && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.linux_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| linux-static-sdk-build: | ||
| name: Static Linux Swift SDK Build (${{ matrix.swift_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }}) | ||
| if: ${{ inputs.enable_linux_static_sdk_build }} | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| swift_version: ${{ fromJson(inputs.linux_static_sdk_versions) }} | ||
| os_version: ${{ fromJson(inputs.linux_os_versions) }} | ||
| arch: ${{ fromJson(inputs.linux_host_archs) }} | ||
| runner: ${{ | ||
| fromJson( | ||
| contains(fromJson(inputs.linux_host_archs), 'x86_64') && !contains(fromJson(inputs.linux_host_archs), 'aarch64') | ||
| && '["ubuntu-24.04"]' | ||
| || contains(fromJson(inputs.linux_host_archs), 'aarch64') && !contains(fromJson(inputs.linux_host_archs), 'x86_64') | ||
| && '["ubuntu-24.04-arm"]' | ||
| || '["ubuntu-24.04","ubuntu-24.04-arm"]' | ||
| ) | ||
| }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.linux_static_sdk_exclude_swift_versions) }} | ||
| - arch: x86_64 | ||
| runner: ubuntu-24.04-arm | ||
| - arch: aarch64 | ||
| runner: ubuntu-24.04 | ||
| container: | ||
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | ||
| steps: | ||
| - name: Swift version | ||
| run: swift --version | ||
| - name: Clang version | ||
| run: clang --version | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| if: ${{ matrix.os_version != 'amazonlinux2' }} | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v1 | ||
| if: ${{ matrix.os_version == 'amazonlinux2' }} | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: github-workflows | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v1 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: ${{ github.event.repository.name }}/github-workflows | ||
| ref: main | ||
| - name: Determine script-root path | ||
| id: script_path | ||
| run: | | ||
| if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then | ||
| echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Set environment variables | ||
| if: ${{ inputs.linux_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.linux_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Pre-build | ||
| run: ${{ inputs.linux_pre_build_command }} | ||
| - name: Install Static Linux Swift SDK and build | ||
| env: | ||
| BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| run: | | ||
| ${{ inputs.linux_static_sdk_pre_build_command }} | ||
| ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action@v2.23.0 | ||
| if: ${{ inputs.linux_static_sdk_publish_test_results && matrix.os_version != 'amazonlinux2 && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.linux_static_sdk_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.linux_static_sdk_publish_test_results && matrix.os_version != 'amazonlinux2 && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.linux_static_sdk_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| wasm-sdk-build: | ||
| name: Swift SDK for Wasm Build (${{ matrix.swift_version }} - ${{ matrix.os_version }}) | ||
| if: ${{ inputs.enable_wasm_sdk_build }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| swift_version: ${{ fromJson(inputs.wasm_sdk_versions) }} | ||
| os_version: ${{ fromJson(inputs.linux_os_versions) }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.wasm_exclude_swift_versions) }} | ||
| container: | ||
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | ||
| steps: | ||
| - name: Swift version | ||
| run: swift --version | ||
| - name: Clang version | ||
| run: clang --version | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| if: ${{ matrix.os_version != 'amazonlinux2' }} | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v1 | ||
| if: ${{ matrix.os_version == 'amazonlinux2' }} | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: github-workflows | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v1 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: ${{ github.event.repository.name }}/github-workflows | ||
| ref: main | ||
| - name: Determine script-root path | ||
| id: script_path | ||
| run: | | ||
| if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then | ||
| echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Set environment variables | ||
| if: ${{ inputs.linux_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.linux_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Pre-build | ||
| run: ${{ inputs.linux_pre_build_command }} | ||
| - name: Install Swift SDK for Wasm and build | ||
| env: | ||
| BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| run: | | ||
| ${{ inputs.wasm_sdk_pre_build_command }} | ||
| ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action@v2.23.0 | ||
| if: ${{ inputs.wasm_sdk_publish_test_results && matrix.os_version != 'amazonlinux2 && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.wasm_sdk_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.wasm_sdk_publish_test_results && matrix.os_version != 'amazonlinux2' && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.wasm_sdk_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| embedded-wasm-sdk-build: | ||
| name: Embedded Swift SDK for Wasm Build (${{ matrix.swift_version }} - ${{ matrix.os_version }}) | ||
| if: ${{ inputs.enable_embedded_wasm_sdk_build }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| swift_version: ${{ fromJson(inputs.wasm_sdk_versions) }} | ||
| os_version: ${{ fromJson(inputs.linux_os_versions) }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.wasm_exclude_swift_versions) }} | ||
| container: | ||
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | ||
| steps: | ||
| - name: Swift version | ||
| run: swift --version | ||
| - name: Clang version | ||
| run: clang --version | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| if: ${{ matrix.os_version != 'amazonlinux2' }} | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v1 | ||
| if: ${{ matrix.os_version == 'amazonlinux2' }} | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: github-workflows | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v1 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: ${{ github.event.repository.name }}/github-workflows | ||
| ref: main | ||
| - name: Determine script-root path | ||
| id: script_path | ||
| run: | | ||
| if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then | ||
| echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Set environment variables | ||
| if: ${{ inputs.linux_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.linux_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Pre-build | ||
| run: ${{ inputs.linux_pre_build_command }} | ||
| - name: Install Swift SDK for Wasm and build | ||
| env: | ||
| BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| run: | | ||
| ${{ inputs.wasm_sdk_pre_build_command }} | ||
| ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action@v2.23.0 | ||
| if: ${{ inputs.wasm_sdk_publish_test_results && matrix.os_version != 'amazonlinux2 && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.wasm_sdk_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.wasm_sdk_publish_test_results && matrix.os_version != 'amazonlinux2' && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.wasm_sdk_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| android-sdk-build: | ||
| name: Swift SDK for Android Build (${{ matrix.swift_version }} - NDK ${{ matrix.ndk_version }}) | ||
| if: ${{ inputs.enable_android_sdk_build }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| swift_version: ${{ fromJson(inputs.android_sdk_versions) }} | ||
| ndk_version: ${{ fromJson(inputs.android_ndk_versions) }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.android_exclude_swift_versions) }} | ||
| steps: | ||
| - name: Swift version | ||
| run: swift --version | ||
| - name: Clang version | ||
| run: clang --version | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: github-workflows | ||
| - name: Determine script-root path | ||
| id: script_path | ||
| run: | | ||
| if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then | ||
| echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
| - name: Set environment variables | ||
| if: ${{ inputs.linux_env_vars }} | ||
| run: | | ||
| for i in "${{ inputs.linux_env_vars }}" | ||
| do | ||
| printf "%s\n" $i >> $GITHUB_ENV | ||
| done | ||
| - name: Pre-build | ||
| run: ${{ inputs.linux_pre_build_command }} | ||
| - name: Install Swift SDK for Android and build | ||
| env: | ||
| BUILD_FLAGS: ${{ inputs.enable_android_sdk_checks && '--build-tests' || '' }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| shell: bash | ||
| run: | | ||
| ${{ inputs.android_sdk_pre_build_command }} | ||
| ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --android --flags="$BUILD_FLAGS" --build-command="${{ inputs.android_sdk_build_command }}" --android-sdk-triple=${{ join(fromJson(inputs.android_sdk_triples), ' --android-sdk-triple=') }} --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }} | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action@v2.23.0 | ||
| if: ${{ inputs.android_sdk_publish_test_results && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.android_sdk_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.android_sdk_publish_test_results && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.android_sdk_publish_test_results_files }} | ||
| reporter: swift-xunit | ||
| - name: Enable KVM and free disk space | ||
| if: ${{ inputs.enable_android_sdk_checks }} | ||
| run: | | ||
| # enable KVM on Linux for tests, else error on emulator launch: | ||
| # CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm). | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
| # need to free space or the emulator runs out | ||
| sudo rm -rf /opt/microsoft /opt/google /opt/az /opt/ghc /usr/share/dotnet /usr/local/share/boost /opt/hostedtoolcache /usr/local/share/chromium | ||
| df -h | ||
| - name: Install Android Emulator and run tests | ||
| if: ${{ inputs.enable_android_sdk_checks }} | ||
| shell: bash | ||
| run: | | ||
| ${{ inputs.android_sdk_pre_build_command }} | ||
| ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/android/android-emulator-tests.sh --android-sdk-triple=${{ join(fromJson(inputs.android_sdk_triples), ' --android-sdk-triple=') }} | ||
| windows-build: | ||
| name: Windows (${{ matrix.swift_version }} - ${{ matrix.os_version }}) | ||
| if: ${{ inputs.enable_windows_checks }} | ||
| runs-on: ${{ matrix.os_version }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| swift_version: ${{ fromJson(inputs.windows_swift_versions) }} | ||
| os_version: ${{ fromJson(inputs.windows_os_versions) }} | ||
| exclude: | ||
| - ${{ fromJson(inputs.windows_exclude_swift_versions) }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Checkout swiftlang/github-workflows repository | ||
| if: ${{ github.repository != 'swiftlang/github-workflows' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: swiftlang/github-workflows | ||
| path: github-workflows | ||
| - name: Determine script-root path | ||
| id: script_path | ||
| run: | | ||
| if ("${{ inputs.enable_windows_docker }}" -eq "true") { | ||
| $source = "C:\source" | ||
| } else { | ||
| $source = $env:GITHUB_WORKSPACE | ||
| } | ||
| if ("${{ github.repository }}" -eq "swiftlang/github-workflows") { | ||
| echo "root=$source" >> $env:GITHUB_OUTPUT | ||
| } else { | ||
| echo "root=$source/github-workflows" >> $env:GITHUB_OUTPUT | ||
| } | ||
| - name: Provide token | ||
| if: ${{ inputs.needs_token }} | ||
| run: | | ||
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
| - name: Set environment variables | ||
| if: ${{ inputs.windows_env_vars }} | ||
| run: | | ||
| $lines = "${{ inputs.windows_env_vars }}" -split "`r`n" | ||
| foreach ($line in $lines) { | ||
| echo $line | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
| } | ||
| - name: Pull Docker image | ||
| id: pull_docker_image | ||
| if: ${{ inputs.enable_windows_docker }} | ||
| run: | | ||
| if ("${{ matrix.swift_version }}".Contains("nightly")) { | ||
| $Image = "swiftlang/swift:${{ matrix.swift_version }}-windowsservercore-ltsc2022" | ||
| } else { | ||
| $Image = "swift:${{ matrix.swift_version }}-windowsservercore-ltsc2022" | ||
| } | ||
| docker pull $Image | ||
| echo "image=$Image" >> "$env:GITHUB_OUTPUT" | ||
| - name: "Install Python 3.10" | ||
| if: ${{ !inputs.enable_windows_docker && !(matrix.swift_version == '6.1' || matrix.swift_version == '6.0' || matrix.swift_version == '5.10' || matrix.swift_version == '5.9') }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
| architecture: "x64" | ||
| - name: "Install Python 3.9" | ||
| if: ${{ !inputs.enable_windows_docker && (matrix.swift_version == '6.1' || matrix.swift_version == '6.0' || matrix.swift_version == '5.10' || matrix.swift_version == '5.9') }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.9" | ||
| architecture: "x64" | ||
| - name: Install Visual Studio Build Tools | ||
| if: ${{ !inputs.enable_windows_docker }} | ||
| run: . ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/windows/install-vsb.ps1 | ||
| - name: Install Swift | ||
| if: ${{ !inputs.enable_windows_docker }} | ||
| run: . ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/windows/swift/install-swift-${{ matrix.swift_version }}.ps1 | ||
| - name: Create test script | ||
| run: | | ||
| mkdir $env:TEMP\test-script | ||
| echo @' | ||
| Set-PSDebug -Trace 1 | ||
| if ("${{ inputs.enable_windows_docker }}" -eq "true") { | ||
| $Source = "C:\source" | ||
| } else { | ||
| $Source = $env:GITHUB_WORKSPACE | ||
| } | ||
| # Run the command following `Invoke-Program`. | ||
| # If that command returns a non-zero exit code, return the same exit code from this script. | ||
| function Invoke-Program($Executable) { | ||
| & $Executable @args | ||
| if ($LastExitCode -ne 0) { | ||
| exit $LastExitCode | ||
| } | ||
| } | ||
| Invoke-Program swift --version | ||
| Invoke-Program swift test --version | ||
| Invoke-Program clang --version | ||
| Invoke-Program cd $Source | ||
| '@ >> $env:TEMP\test-script\run.ps1 | ||
| if ("${{ inputs.enable_cross_pr_testing && github.event_name == 'pull_request' }}" -eq "true") { | ||
| echo @' | ||
| # Running in script mode fails on Windows (https://github.com/swiftlang/swift/issues/77263), compile and run the script. | ||
| Invoke-Program swiftc -sdk $env:SDKROOT ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/cross-pr-checkout.swift -o $env:TEMP\cross-pr-checkout.exe | ||
| Invoke-Program $env:TEMP\cross-pr-checkout.exe "${{ github.repository }}" "${{ github.event.number }}" | ||
| '@ >> $env:TEMP\test-script\run.ps1 | ||
| } | ||
| echo @' | ||
| ${{ inputs.windows_pre_build_command }} | ||
| ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} | ||
| '@ >> $env:TEMP\test-script\run.ps1 | ||
| # Docker build | ||
| - name: Docker Build / Test | ||
| timeout-minutes: ${{ inputs.windows_build_timeout }} | ||
| if: ${{ inputs.enable_windows_docker }} | ||
| run: | | ||
| docker run -v ${{ github.workspace }}:C:\source -v $env:TEMP\test-script:C:\test-script ${{ steps.pull_docker_image.outputs.image }} powershell.exe -NoLogo -File C:\test-script\run.ps1 | ||
| # Docker-less build | ||
| - name: Build / Test | ||
| timeout-minutes: ${{ inputs.windows_build_timeout }} | ||
| if: ${{ !inputs.enable_windows_docker }} | ||
| run: powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1; exit $LastExitCode | ||
| - name: "Publish Test results - EnricoMI" | ||
| uses: EnricoMi/publish-unit-test-result-action/windows@v2.23.0 | ||
| if: ${{ inputs.windows_publish_test_results && always() }} | ||
| with: | ||
| comment_mode: off | ||
| files: ${{ inputs.windows_publish_test_results_files }} | ||
| report_individual_runs: true | ||
| action_fail: true | ||
| action_fail_on_inconclusive: true | ||
| - name: "Publish test results - test-reporter" | ||
| uses: dorny/test-reporter@v2.5.0 | ||
| if: ${{ inputs.windows_publish_test_results && always() }} | ||
| with: | ||
| name: "Test Reporter: ${{ github.action }}" | ||
| report-title: "Test Reporter: ${{ github.action }}" | ||
| path: ${{ inputs.windows_publish_test_results_files }} | ||
| reporter: swift-xunit | ||