Merge pull request #38 from gumob:release/v2.2.0 #39
This file contains 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
# This workflow will build a Swift project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | |
name: Swift | |
on: | |
push: | |
# branches: | |
# - develop | |
branches-ignore: | |
- "release/**" | |
- "feature/**" | |
paths: | |
- .github/workflows/** | |
- .swiftlint.yml | |
- Package.swift | |
- Punycode.podspec | |
- Punycode.xcodeproj/** | |
- Source/** | |
- Tests/** | |
pull_request: | |
# branches: | |
# - develop | |
branches-ignore: | |
- "release/**" | |
- "feature/**" | |
paths: | |
- .github/workflows/** | |
- .swiftlint.yml | |
- Package.swift | |
- Punycode.podspec | |
- Punycode.xcodeproj/** | |
- Source/** | |
- Tests/** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
swiftlint: | |
runs-on: macos-14 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install SwiftLint | |
run: brew install swiftlint | |
- name: Lint | |
run: | | |
set -o pipefail | |
swiftlint lint --quiet | sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 title=Lint error,file=\1,line=\2,col=\3::\5\n\1:\2:\3/' | |
### ref: https://github.com/Alamofire/Alamofire/blob/master/.github/workflows/ci.yml | |
macOS: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.runsOn }} | |
env: | |
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- xcode: "Xcode_15.4" | |
runsOn: macos-14 | |
name: "macOS 14, Xcode 15.4, Swift 5.10" | |
testPlan: "macOS" | |
outputFilter: xcbeautify --renderer github-actions | |
- xcode: "Xcode_15.2" | |
runsOn: macos-14 | |
name: "macOS 14, Xcode 15.2, Swift 5.9.2" | |
testPlan: "macOS" | |
outputFilter: xcbeautify --renderer github-actions | |
# - xcode: "Xcode_15.1" | |
# runsOn: macOS-14 | |
# name: "macOS 14, Xcode 15.1, Swift 5.9.1" | |
# testPlan: "macOS" | |
# outputFilter: xcbeautify --renderer github-actions | |
# - xcode: "Xcode_15.0.1" | |
# runsOn: macOS-14 | |
# name: "macOS 14, Xcode 15.0.1, Swift 5.9.0" | |
# testPlan: "macOS" | |
# outputFilter: xcbeautify --renderer github-actions | |
- xcode: "Xcode_14.3.1" | |
runsOn: macOS-13 | |
name: "macOS 13, Xcode 14.3.1, Swift 5.8.0" | |
testPlan: "macOS" | |
outputFilter: xcbeautify --renderer github-actions | |
- xcode: "Xcode_14.2" | |
runsOn: macOS-12 | |
name: "macOS 12, Xcode 14.2, Swift 5.7.2" | |
testPlan: "macOS" | |
outputFilter: xcpretty | |
# - xcode: "Xcode_14.1" | |
# runsOn: macOS-12 | |
# name: "macOS 12, Xcode 14.1, Swift 5.7.1" | |
# testPlan: "macOS" | |
# outputFilter: xcpretty | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ${{ matrix.name }} | |
run: |- | |
set -o pipefail | |
# brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk | |
# firewalk & | |
env NSUnbufferedIO=YES xcodebuild -project "Punycode.xcodeproj" -scheme "Punycode-macOS" -destination "platform=macOS" clean test | ${{ matrix.outputFilter }} | |
needs: swiftlint | |
# Catalyst: | |
# name: ${{ matrix.name }} | |
# runs-on: ${{ matrix.runsOn }} | |
# env: | |
# DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer | |
# timeout-minutes: 10 | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# include: | |
# - xcode: "Xcode_15.4" | |
# name: "Catalyst 15.4" | |
# runsOn: macos-14 | |
# - xcode: "Xcode_15.2" | |
# name: "Catalyst 15.2" | |
# runsOn: macos-14 | |
# - xcode: "Xcode_15.1" | |
# name: "Catalyst 15.1" | |
# runsOn: macOS-14 | |
# - xcode: "Xcode_15.0.1" | |
# name: "Catalyst 15.0" | |
# runsOn: macOS-14 | |
# - xcode: "Xcode_14.3.1" | |
# name: "Catalyst 14.3.1" | |
# runsOn: macOS-13 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Install Firewalk | |
# run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & | |
# - name: Catalyst | |
# run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Punycode.xcodeproj" -scheme "Punycode-iOS" -destination "platform=macOS" clean test 2>&1 | xcbeautify --renderer github-actions | |
iOS: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.runsOn }} | |
env: | |
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- destination: "OS=17.5,name=iPhone 15 Pro" | |
name: "iOS 17.6" | |
testPlan: "iOS" | |
xcode: "Xcode_15.4" | |
runsOn: macos-14 | |
# - destination: "OS=17.2,name=iPhone 15 Pro" | |
# name: "iOS 17.2" | |
# testPlan: "iOS" | |
# xcode: "Xcode_15.2" | |
# runsOn: macos-14 | |
# - destination: "OS=17.0,name=iPhone 15 Pro" | |
# name: "iOS 17.0" | |
# testPlan: "iOS" | |
# xcode: "Xcode_15.0.1" | |
# runsOn: macOS-14 | |
- destination: "OS=16.4,name=iPhone 14 Pro" | |
name: "iOS 16.4" | |
testPlan: "iOS" | |
xcode: "Xcode_14.3.1" | |
runsOn: macOS-13 | |
steps: | |
- uses: actions/checkout@v4 | |
# - name: Install Firewalk | |
# run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & | |
- name: ${{ matrix.name }} | |
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Punycode.xcodeproj" -scheme "Punycode-iOS" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions | |
needs: swiftlint | |
tvOS: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.runsOn }} | |
env: | |
DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- destination: "OS=17.5,name=Apple TV" | |
name: "tvOS 17.5" | |
testPlan: "tvOS" | |
xcode: "Xcode_15.4" | |
runsOn: macos-14 | |
# - destination: "OS=17.2,name=Apple TV" | |
# name: "tvOS 17.2" | |
# testPlan: "tvOS" | |
# xcode: "Xcode_15.2" | |
# runsOn: macos-14 | |
# - destination: "OS=17.0,name=Apple TV" | |
# name: "tvOS 17.0" | |
# testPlan: "tvOS" | |
# xcode: "Xcode_15.0.1" | |
# runsOn: macOS-14 | |
- destination: "OS=16.4,name=Apple TV" | |
name: "tvOS 16.4" | |
testPlan: "tvOS" | |
xcode: "Xcode_14.3.1" | |
runsOn: macOS-13 | |
steps: | |
- uses: actions/checkout@v4 | |
# - name: Install Firewalk | |
# run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & | |
- name: ${{ matrix.name }} | |
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Punycode.xcodeproj" -scheme "Punycode-tvOS" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions | |
needs: swiftlint | |
# visionOS: | |
# name: ${{ matrix.name }} | |
# runs-on: ${{ matrix.runsOn }} | |
# env: | |
# DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
# timeout-minutes: 10 | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# include: | |
# - destination: "OS=1.2,name=Apple Vision Pro" | |
# name: "visionOS 1.2" | |
# testPlan: "visionOS" | |
# scheme: "Punycode visionOS" | |
# xcode: "Xcode_15.4" | |
# runsOn: macos-14 | |
# - destination: "OS=1.0,name=Apple Vision Pro" | |
# name: "visionOS 1.0" | |
# testPlan: "visionOS" | |
# scheme: "Punycode visionOS" | |
# xcode: "Xcode_15.2" | |
# runsOn: macos-14 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Install Firewalk | |
# run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & | |
# - name: ${{ matrix.name }} | |
# run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Punycode.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions | |
# watchOS: | |
# name: ${{ matrix.name }} | |
# runs-on: ${{ matrix.runsOn }} | |
# env: | |
# DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer | |
# timeout-minutes: 10 | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# include: | |
# - destination: "OS=10.5,name=Apple Watch Series 9 (45mm)" | |
# name: "watchOS 10.5" | |
# testPlan: "watchOS" | |
# xcode: "Xcode_15.4" | |
# runsOn: macos-14 | |
# - destination: "OS=10.2,name=Apple Watch Series 9 (45mm)" | |
# name: "watchOS 10.2" | |
# testPlan: "watchOS" | |
# xcode: "Xcode_15.2" | |
# runsOn: macos-14 | |
# - destination: "OS=10.0,name=Apple Watch Series 9 (45mm)" | |
# name: "watchOS 10.0" | |
# testPlan: "watchOS" | |
# xcode: "Xcode_15.0.1" | |
# runsOn: macOS-14 | |
# - destination: "OS=9.4,name=Apple Watch Series 8 (45mm)" | |
# name: "watchOS 9.4" | |
# testPlan: "watchOS" | |
# xcode: "Xcode_14.3.1" | |
# runsOn: macOS-13 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Install Firewalk | |
# run: brew update && brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & | |
# - name: ${{ matrix.name }} | |
# run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Punycode.xcodeproj" -scheme "Punycode-watchOS" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions | |
SPM: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.runsOn }} | |
env: | |
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- xcode: "Xcode_15.4" | |
runsOn: macOS-14 | |
name: "macOS 14, SPM 5.10 Test" | |
outputFilter: xcbeautify --renderer github-actions | |
- xcode: "Xcode_15.2" | |
runsOn: macOS-14 | |
name: "macOS 14, SPM 5.9.2 Test" | |
outputFilter: xcbeautify --renderer github-actions | |
# - xcode: "Xcode_15.1" | |
# runsOn: macOS-14 | |
# name: "macOS 14, SPM 5.9.1 Test" | |
# outputFilter: xcbeautify --renderer github-actions | |
# - xcode: "Xcode_15.0.1" | |
# runsOn: macOS-14 | |
# name: "macOS 14, SPM 5.9.0 Test" | |
# outputFilter: xcbeautify --renderer github-actions | |
- xcode: "Xcode_14.3.1" | |
runsOn: macOS-13 | |
name: "macOS 13, SPM 5.8.0 Test" | |
outputFilter: xcbeautify --renderer github-actions | |
- xcode: "Xcode_14.2" | |
runsOn: macOS-12 | |
name: "macOS 12, SPM 5.7.2 Test" | |
outputFilter: xcpretty | |
# - xcode: "Xcode_14.1" | |
# runsOn: macOS-12 | |
# name: "macOS 12, SPM 5.7.1 Test" | |
# outputFilter: xcpretty | |
steps: | |
- uses: actions/checkout@v4 | |
# - name: Install Firewalk | |
# run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk xcbeautify && firewalk & | |
- name: Test SPM | |
run: swift test -c debug 2>&1 | ${{ matrix.outputFilter }} | |
needs: swiftlint | |
# spm: | |
# name: Swift ${{ matrix.swift }} | |
# runs-on: macos-14 | |
# strategy: | |
# matrix: | |
# # swift: ["5.10", "5.9", "5.8", "5.0"] | |
# swift: ["5.10"] | |
# steps: | |
# - name: Setup Swift | |
# uses: swift-actions/setup-swift@v2 | |
# with: | |
# swift-version: ${{ matrix.swift }} | |
# - name: Get swift version | |
# run: swift --version | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Build | |
# run: swift build --disable-sandbox | |
# - name: Run tests | |
# run: swift test --disable-sandbox | |
# needs: swiftlint | |
# build: | |
# name: ${{ matrix.run-config.scheme }} | |
# runs-on: macos-14 | |
# strategy: | |
# matrix: | |
# scheme: | |
# - Punycode-iOS | |
# - Punycode-tvOS | |
# - Punycode-macOS | |
# # destination: | |
# # - "OS=iOS 18.1,name=iphonesimulator18.1" | |
# # - "OS=iOS 17.5,name=iphonesimulator17.5" | |
# # - "OS=iOS 16.4,name=iphonesimulator16.4" | |
# # - "OS=tvOS 18.0,name=appletvsimulator18.0" | |
# # - "OS=tvOS 17.5,name=appletvsimulator17.5" | |
# # - "OS=tvOS 16.4,name=appletvsimulator16.4" | |
# # - "OS=macOS 15.1,name=macosx15.1" | |
# # - "OS=macOS 14.5,name=macosx14.5" | |
# # - "OS=macOS 13.3,name=macosx13.3" | |
# # - "arch=x86_64" | |
# - name: Build and Test | |
# run: | | |
# set -o pipefail | |
# swift -version | |
# xcrun simctl list | |
# xcodebuild -version | |
# xcodebuild -showsdks | |
# xcodebuild -list | |
# xcodebuild clean test -project "Punycode.xcodeproj" -scheme ${{ matrix.scheme }} -destination ${{ matrix.destination }} -enableCodeCoverage | |
# - name: Upload Coverage | |
# if: success() && github.event_name == 'push' | |
# run: bash <(curl -s https://codecov.io/bash) -J 'Punycode' -cF "${{ matrix.scheme }}" | |
# spm: | |
# name: Swift ${{ matrix.swift }} | |
# runs-on: macos-14 | |
# strategy: | |
# matrix: | |
# # swift: ["5.10", "5.9", "5.8", "5.0"] | |
# swift: ["5.10"] | |
# steps: | |
# - name: Setup Swift | |
# uses: swift-actions/setup-swift@v2 | |
# with: | |
# swift-version: ${{ matrix.swift }} | |
# - name: Get swift version | |
# run: swift --version | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Build | |
# run: swift build --disable-sandbox | |
# - name: Run tests | |
# run: swift test --disable-sandbox | |
# needs: test | |
carthage: | |
runs-on: macos-14 | |
strategy: | |
fail-fast: true | |
matrix: | |
# platform: ["ios", "macos", "tvos", "visionos", "watchos --skip-tests"] | |
platform: ["ios", "macos", "tvos"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run SwiftLint and Build Carthage for ${{ matrix.platform }} | |
run: | | |
carthage build \ | |
--no-skip-current \ | |
--platform ${{ matrix.platform }} \ | |
--use-xcframeworks \ | |
--cache-builds | |
needs: SPM | |
cocoapods: | |
runs-on: macos-14 | |
strategy: | |
fail-fast: true | |
matrix: | |
### watchOS fails linting when there are test, wedge in --skip-tests for those runs. | |
scheme: ["Punycode-iOS", "Punycode-macOS", "Punycode-tvOS"] | |
# platform: ["ios", "macos", "tvos", "visionos", "watchos --skip-tests"] | |
platform: ["ios", "macos", "tvos"] | |
configuration: ["Debug", "Release"] | |
steps: | |
### The "macos-14" image defaults to 15.0.1, select the newer Xcode. | |
- name: Xcode version | |
run: sudo xcode-select -switch /Applications/Xcode_15.4.app | |
### The "macos-14" image has CocoaPods 1.14.x, and 1.15 is needed for visionOS | |
- name: Update CocoaPods | |
if: ${{ matrix.platform == 'visionos' }} | |
run: gem install cocoapods | |
- name: Checkout | |
uses: actions/checkout@v4 | |
### Manually expanding out static frameworks to avoid making to many jobs. | |
- name: Pod lib lint | |
run: | | |
pod lib lint --verbose \ | |
--configuration=${{ matrix.configuration }} \ | |
--platforms=${{ matrix.platform }} \ | |
Punycode.podspec | |
- name: Pod lib lint - Use Static Frameworks | |
run: | | |
pod lib lint --verbose --use-static-frameworks \ | |
--configuration=${{ matrix.configuration }} \ | |
--platforms=${{ matrix.platform }} \ | |
Punycode.podspec | |
needs: carthage |