Skip to content

Update for Xcode 14 #56

Update for Xcode 14

Update for Xcode 14 #56

Workflow file for this run

name: macOS
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
# This job is not a part of the macos_test job because of
# the 'This copy of libswiftCore.dylib requires an OS version prior to 10.14.4.' error.
# We have to invoke install_name_tool and patch the test executable
# to work around this error.
#
# Other combinations of Xcode and macOS versions don't lead to this error.
swift_5_0_test:
name: Execute tests (macos-10.15, 10.3)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "10.3"
- name: Swift version
run: swift --version
- name: Build and run tests in debug mode with coverage
run: |
swift build \
--build-tests \
-c debug \
-Xswiftc -warnings-as-errors \
-Xswiftc -profile-generate \
-Xswiftc -profile-coverage-mapping \
--build-path .build-test-debug
install_name_tool \
-rpath /Applications/Xcode_10.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx /usr/lib/swift \
.build-test-debug/debug/OpenCombinePackageTests.xctest/Contents/MacOS/OpenCombinePackageTests
install_name_tool \
-add_rpath /Applications/Xcode_10.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx \
.build-test-debug/debug/OpenCombinePackageTests.xctest/Contents/MacOS/OpenCombinePackageTests
swift test \
--skip-build \
--enable-code-coverage \
--build-path .build-test-debug
xcrun llvm-cov show \
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
.build-test-debug/debug/OpenCombinePackageTests.xctest/Contents/MacOS/OpenCombinePackageTests \
> coverage.txt
- name: Build and run tests in release mode
run: |
swift build \
--build-tests \
-c release \
-Xswiftc -warnings-as-errors \
-Xswiftc -profile-generate \
-Xswiftc -profile-coverage-mapping \
--build-path .build-test-release
install_name_tool \
-rpath /Applications/Xcode_10.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx /usr/lib/swift \
.build-test-release/release/OpenCombinePackageTests.xctest/Contents/MacOS/OpenCombinePackageTests
install_name_tool \
-add_rpath /Applications/Xcode_10.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx \
.build-test-release/release/OpenCombinePackageTests.xctest/Contents/MacOS/OpenCombinePackageTests
swift test \
--skip-build \
-c release \
--enable-code-coverage \
--build-path .build-test-release
- uses: codecov/codecov-action@v2
with:
verbose: true
macos_test:
name: Execute tests
strategy:
fail-fast: false
matrix:
include:
- os: macos-10.15
xcode-version: "11.3.1" # Swift 5.1.3
- os: macos-10.15
xcode-version: "11.7" # Swift 5.2.4
- os: macos-11
xcode-version: "12.4" # Swift 5.3.2
- os: macos-11
xcode-version: "12.5.1" # Swift 5.4.2
- os: macos-11
xcode-version: "13.2.1" # Swift 5.5.2
- os: macos-12
xcode-version: "13.4.1" # Swift 5.6.1
- os: macos-12
xcode-version: "14.2" # Swift 5.7.2
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode-version }}
- name: Swift version
run: swift --version
- name: Build and run tests in debug mode with coverage
run: |
swift test \
-c debug \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-debug
xcrun llvm-cov show \
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
.build-test-debug/debug/OpenCombinePackageTests.xctest/Contents/MacOS/OpenCombinePackageTests \
> coverage.txt
- name: Build and run tests in debug mode with TSan
if: ${{ matrix.xcode-version != '13.2.1' && matrix.xcode-version != '13.4.1' }} # https://bugs.swift.org/browse/SR-15444
run: |
swift test \
-c debug \
--sanitize thread \
-Xswiftc -warnings-as-errors \
--build-path .build-test-debug-sanitize-thread
- name: Build and run tests in release mode
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-release
- uses: codecov/codecov-action@v2
with:
verbose: true