Skip to content

[6.4] GHA: Enable Testing on Windows #2056

[6.4] GHA: Enable Testing on Windows

[6.4] GHA: Enable Testing on Windows #2056

Workflow file for this run

name: Pull request
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
needs: [soundness]
strategy:
fail-fast: false
name: Build
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.12
with:
enable_cross_pr_testing: true
linux_os_versions: '["amazonlinux2023", "bookworm", "noble", "jammy", "rhel-ubi9"]'
linux_swift_versions: '["nightly-main", "nightly-6.4.x"]'
linux_pre_build_command: ./.github/scripts/prebuild.sh
linux_build_command: 'swift --version && swift run swift-build --build-tests'
# enable_android_sdk_build: true
# android_sdk_build_command: "swift --version && swift run swift-build --build-tests --build-system swiftbuild"
# android_ndk_versions: '["r27d", "r29"]'
enable_windows_checks: false
enable_linux_checks: false
enable_macos_checks: false
# enable_macos_checks: true
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.4\"}]"
macos_build_command: 'swift --version && swift run swift-build --build-tests'
enable_ios_checks: false
# ios_build_command: 'swift --version && swift run swift-build --build-tests --sdk \"$(xcrun --sdk iphoneos --show-sdk-path)\" --triple arm64-apple-ios'
build-and-test-windows:
# needs: [soundness]
strategy:
fail-fast: false
matrix:
windows_with_docker: [true, false]
name: "Build and Test ${{ case(matrix.windows_with_docker, 'with', 'without') }} Docker"
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.11
with:
enable_cross_pr_testing: false
enable_linux_checks: false
enable_macos_checks: false
enable_ios_checks: false
enable_windows_checks: true
enable_windows_docker: ${{ matrix.windows_with_docker }}
windows_build_timeout: 480
windows_swift_versions: ${{ case(matrix.windows_with_docker,'["nightly-main", "nightly-6.4.x", "nightly-6.3", "6.3.0"]', '["nightly-main", "nightly-6.4.x"]') }}
windows_pre_build_command: 'Invoke-Program .\.github\scripts\prebuild.ps1 -SkipAndroid'
windows_build_command: 'Invoke-Program swift --version ; Invoke-Program swift test -Xlinker /ignore:4217 --parallel --experimental-xunit-message-failure --xunit-output windows-xunit.xml' # --filter BasicsTests'
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.12
with:
license_header_check_project_name: "Swift"
license_header_check_enabled: true
unacceptable_language_check_enabled: true
api_breakage_check_enabled: false
format_check_enabled: false
shell_check_enabled: false
docs_check_enabled: true
docs_check_analyze: false
docs_check_targets: "PackageManagerDocs"
docs_check_macos_enabled: false
broken_symlink_check_enabled: true
python_lint_check_enabled: true
yamllint_check_enabled: true
integration-tests:
name: Integration Tests
needs: [soundness]
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.12
with:
enable_linux_checks: false
enable_windows_checks: false
enable_macos_checks: false
enable_wasm_sdk_build: true
wasm_sdk_versions: '["nightly-main"]'
wasm_sdk_pre_build_command: ./.github/scripts/prebuild.sh
# This is a hack - replace the build command with a test command and drop the --swift-sdk arg the workflow appends.
wasm_sdk_build_command: "swift --version && swift test --parallel --experimental-xunit-message-failure --xunit-output wasm-xunit.xml --filter WebAssemblyIntegrationTests #"
enable_linux_static_sdk_build: true
linux_static_sdk_versions: '["nightly-main"]'
linux_static_sdk_pre_build_command: ./.github/scripts/prebuild.sh
# This is a hack - replace the build command with a test command and drop the --swift-sdk arg the workflow appends.
linux_static_sdk_build_command: "swift --version && swift test --parallel --experimental-xunit-message-failure --xunit-output static-linux-xunit.xml --filter StaticLinuxIntegrationTests #"
enable_android_sdk_build: true
android_sdk_build_command: "swift --version && swift test --parallel --experimental-xunit-message-failure --xunit-output android-xunit.xml --filter AndroidSDKIntegrationTests #"
required:
name: Required
runs-on: ubuntu-latest
needs:
- build
- build-and-test-windows
- soundness
- integration-tests
if: always() # Runs even if previous jobs fail so it can evaluate them
steps:
- name: Install required tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends coreutils jq
- name: Check upstream job statuses
env:
NEEDS_JSON: ${{ toJSON(needs) }}
run: |
failed=$(printf '%s' "$NEEDS_JSON" | jq -r 'to_entries | map(select(.value.result != "success")) | .[] | "\(.key): \(.value.result)"')
if [ -n "$failed" ]; then
echo "The following required jobs did not succeed:"
printf '%s\n' "$failed"
exit 1
fi
echo "All required jobs passed successfully!"