Merge pull request #32 from gumob:release/v2.2.0 #27
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 | |
- "!release/**" | |
paths: | |
- .github/workflows/** | |
- .swiftlint.yml | |
- Package.swift | |
- Punycode.podspec | |
- Punycode.xcodeproj/** | |
- Source/** | |
- Tests/** | |
pull_request: | |
branches: | |
- develop | |
- "!release/**" | |
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/' | |
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 | |
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 | |
# test: | |
# runs-on: macos-14 | |
# strategy: | |
# fail-fast: true | |
# matrix: | |
# scheme: ["Punycode-iOS", "Punycode-macOS", "Punycode-tvOS"] | |
# 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" | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Run tests | |
# run: | | |
# xcodebuild clean test -project "Punycode.xcodeproj" \ | |
# -scheme ${{ matrix.scheme }} \ | |
# -destination ${{ matrix.destination }} \ | |
# -enableCodeCoverage | |
# needs: cocoapods | |
# 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 }}" |