Skip to content

Commit

Permalink
Initial support for swift-docc documentation and bump to Swift 5.7 (#2)
Browse files Browse the repository at this point in the history
* Initial support for swift-docc documentation

* Update OpenCombine.md

* Remove unneccessary Swift 5.7 check code

* Update CI job

* Fix Swift 6 warning issue

* Remove cocoapods support and update action

* Fix compile issue on some Xcode version

* Fix testMapKeyPathReflection test case on Swift 5.8+

* Fix PublisherConcurrencyTests case on some Swift version

* Skip some tests on DispatchQueueSchedulerTests

* Skip some tests on Linux platform

This is failing on GitHub action but I can’t reproduce it locally on Ubuntu 22.04 + Swift 5.9.2

* Add TSAN check support and skip some tests on Linux when TSAN is enabled

Compiler.h is from WebKit code

See https://github.com/WebKit/WebKit/blob/57feb7424beb442bf5df7ca404f4439bbad72717/Source/WTF/wtf/Compiler.h

* Update macos yml to skip release test on Xcode 14.3.1

* Skip assertCrashes on Linux + TSAN

* Skip another flacky test on macOS
  • Loading branch information
Kyle-Ye authored Dec 19, 2023
1 parent 1c6f02c commit 3b505ba
Show file tree
Hide file tree
Showing 42 changed files with 617 additions and 1,260 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/cocoapods.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Compatibility tests

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]
schedule:
- cron: "0 9 * * 1" # Every Monday at 9:00 AM

Expand All @@ -13,7 +13,7 @@ jobs:
name: Execute compatibility tests
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run tests against Apple's Combine
run: make test-compatibility

89 changes: 9 additions & 80 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,26 @@ name: macOS

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

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
- os: macos-13
xcode-version: "14.3.1" # Swift 5.8.1
- os: macos-13
xcode-version: "15.0.1" # Swift 5.9
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
Expand All @@ -111,20 +40,20 @@ jobs:
.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
if: ${{ matrix.xcode-version != '14.3.1' }} # error: no input files specified. See llvm-profdata merge -help
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-release
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
with:
verbose: true
4 changes: 2 additions & 2 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ on:

jobs:
SwiftLint:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
# Fetch current versions of files
- name: Fetch base ref
run: |
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,27 @@ name: Ubuntu

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
ubuntu_test:
name: Execute tests on Ubuntu
strategy:
fail-fast: false
matrix:
swift_version: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7"]
runs-on: ubuntu-latest
container: swift:${{ matrix.swift_version }}-bionic
swift_version: ["5.9.2"]
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
os_name: focal
- os: ubuntu-22.04
os_name: jammy
runs-on: ${{ matrix.os }}
container: swift:${{ matrix.swift_version }}-${{ matrix.os_name }}
steps:
- uses: actions/checkout@v2
- name: Generating LinuxMain.swift
if: >-
${{ matrix.swift_version == '5.0' ||
matrix.swift_version == '5.1' ||
matrix.swift_version == '5.2' ||
matrix.swift_version == '5.3' }}
run: |
apt update -y
apt upgrade -y
apt install -y python3.8
python3.8 utils/discover_tests.py
- name: Building and running tests in debug mode with coverage
run: |
swift test \
Expand All @@ -40,7 +35,6 @@ jobs:
.build-test-debug/debug/OpenCombinePackageTests.xctest \
> coverage.txt
- name: Building and running tests in debug mode with TSan
if: ${{ matrix.swift_version != '5.0' }} # There are false positives there
run: |
swift test \
-c debug \
Expand All @@ -52,6 +46,6 @@ jobs:
-c release \
-Xswiftc -warnings-as-errors \
--build-path .build-test-release
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
with:
verbose: true
53 changes: 19 additions & 34 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,32 @@ name: Wasm

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
carton_wasmer_test_5_3:
name: "Execute tests on Wasm (Swift 5.3)"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: swiftwasm/[email protected]

carton_wasmer_test_5_4:
name: "Execute tests on Wasm (Swift 5.4)"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: swiftwasm/[email protected]

carton_wasmer_test_5_5:
name: "Execute tests on Wasm (Swift 5.5)"
carton_wasmer_test_5_7:
name: "Execute tests on Wasm (Swift 5.7)"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: swiftwasm/swiftwasm-action@v5.5
- uses: actions/checkout@v4
- uses: swiftwasm/swiftwasm-action@v5.7

carton_wasmer_test_5_6:
name: "Execute tests on Wasm (Swift 5.6)"
runs-on: ubuntu-20.04
# swiftwasm/[email protected] and @v5.9 is not supported upstream
# carton_wasmer_test_5_8:
# name: "Execute tests on Wasm (Swift 5.8)"
# runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: swiftwasm/swiftwasm-action@v5.6
# steps:
# - uses: actions/checkout@v2
# - uses: swiftwasm/swiftwasm-action@v5.8

carton_wasmer_test_5_7:
name: "Execute tests on Wasm (Swift 5.7)"
runs-on: ubuntu-20.04
# carton_wasmer_test_5_9:
# name: "Execute tests on Wasm (Swift 5.9)"
# runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: swiftwasm/swiftwasm-action@v5.7
# steps:
# - uses: actions/checkout@v2
# - uses: swiftwasm/swiftwasm-action@v5.9
14 changes: 4 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Windows

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
windows_test:
Expand All @@ -14,16 +14,10 @@ jobs:
matrix:
include:
- os: windows-2019
swift_version: "5.4.2"
- os: windows-2019
swift_version: "5.5.1"
- os: windows-2019
swift_version: "5.6.1"
- os: windows-2019
swift_version: "5.7.2"
swift_version: "5.9.2"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: compnerd/gha-setup-swift@main
with:
branch: swift-${{ matrix.swift_version }}-release
Expand Down
5 changes: 5 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
builder:
configs:
- swift_version: 5.9
documentation_targets: [OpenCombine, OpenCombineDispatch, OpenCombineFoundation]
27 changes: 0 additions & 27 deletions OpenCombine.podspec

This file was deleted.

25 changes: 0 additions & 25 deletions OpenCombineDispatch.podspec

This file was deleted.

Loading

0 comments on commit 3b505ba

Please sign in to comment.