Skip to content

Commit

Permalink
fixing workflows for Swift 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Jul 30, 2024
1 parent 6b6dfc9 commit ebd379b
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 498 deletions.
94 changes: 11 additions & 83 deletions .github/workflows/Ngrokit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ jobs:
build-ubuntu:
name: Build on Ubuntu
env:
SWIFT_VER: ${{ matrix.swift-version }}
runs-on: ${{ matrix.runs-on }}
SWIFT_VER: 6.0
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
swift-version: ["5.10"]
runs-on: ubuntu-latest
container:
image: swiftlang/swift:nightly-6.0-jammy
steps:
- uses: actions/checkout@v4
- name: Set Ubuntu Release DOT
Expand All @@ -40,24 +38,6 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-
- name: Cache swift
id: cache-swift-linux
uses: actions/cache@v4
env:
cache-name: cache-swift
with:
path: swift-${{ env.SWIFT_VER }}-RELEASE-ubuntu${{ env.RELEASE_DOT }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ env.RELEASE_DOT }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
- name: Download Swift
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
run: curl -O https://download.swift.org/swift-${SWIFT_VER}-release/ubuntu${RELEASE_NUM}/swift-${SWIFT_VER}-RELEASE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
- name: Extract Swift
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
run: tar xzf swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
- name: Add Path
run: echo "$GITHUB_WORKSPACE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}/usr/bin" >> $GITHUB_PATH
- name: Test
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
Expand All @@ -79,16 +59,10 @@ jobs:
strategy:
matrix:
include:
- xcode: "/Applications/Xcode_15.3.app"
- xcode: "/Applications/Xcode_16.0.app"
os: macos-14
iOSVersion: "17.2"
watchOSVersion: "10.2"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 15 Pro"
- xcode: "/Applications/Xcode_15.4.app"
os: macos-14
iOSVersion: "17.4"
watchOSVersion: "10.4"
iOSVersion: "18.0"
watchOSVersion: "11.0"
watchName: "Apple Watch Ultra 2 (49mm)"
iPhoneName: "iPhone 15 Pro Max"
steps:
Expand All @@ -104,7 +78,7 @@ jobs:
restore-keys: |
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
- name: Cache mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.0')
id: cache-mint
uses: actions/cache@v4
env:
Expand All @@ -121,7 +95,7 @@ jobs:
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
- name: Install mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.0')
run: |
brew update
brew install mint
Expand All @@ -143,7 +117,7 @@ jobs:
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.0')
- name: Run iOS target tests
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }}-Package -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
Expand Down Expand Up @@ -171,50 +145,4 @@ jobs:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }}
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
build-self:
name: Build on Self-Hosting macOS
runs-on: [self-hosted, macOS]
if: github.event.repository.owner.login == github.event.organization.login && !contains(github.event.head_commit.message, 'ci skip')
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
id: cache-spm-macos
uses: actions/cache@v4
env:
cache-name: cache-spm
with:
path: .build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache mint
id: cache-mint
uses: actions/cache@v4
env:
cache-name: cache-mint
with:
path: .mint
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Mintfile') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build
run: swift build
- name: Run Swift Package tests
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
with:
fail-on-empty-output: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: macOS,${{ env.XCODE_NAME }}
- name: Clean up spm build directory
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
94 changes: 11 additions & 83 deletions .github/workflows/Sublimation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ jobs:
build-ubuntu:
name: Build on Ubuntu
env:
SWIFT_VER: ${{ matrix.swift-version }}
runs-on: ${{ matrix.runs-on }}
SWIFT_VER: 6.0
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
swift-version: ["5.10"]
runs-on: ubuntu-latest
container:
image: swiftlang/swift:nightly-6.0-jammy
steps:
- uses: actions/checkout@v4
- name: Set Ubuntu Release DOT
Expand All @@ -35,24 +33,6 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-
- name: Cache swift
id: cache-swift-linux
uses: actions/cache@v4
env:
cache-name: cache-swift
with:
path: swift-${{ env.SWIFT_VER }}-RELEASE-ubuntu${{ env.RELEASE_DOT }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ env.RELEASE_DOT }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
- name: Download Swift
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
run: curl -O https://download.swift.org/swift-${SWIFT_VER}-release/ubuntu${RELEASE_NUM}/swift-${SWIFT_VER}-RELEASE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
- name: Extract Swift
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
run: tar xzf swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
- name: Add Path
run: echo "$GITHUB_WORKSPACE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}/usr/bin" >> $GITHUB_PATH
- name: Test
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
Expand All @@ -74,16 +54,10 @@ jobs:
strategy:
matrix:
include:
- xcode: "/Applications/Xcode_15.3.app"
- xcode: "/Applications/Xcode_16.0.app"
os: macos-14
iOSVersion: "17.2"
watchOSVersion: "10.2"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 15 Pro"
- xcode: "/Applications/Xcode_15.4.app"
os: macos-14
iOSVersion: "17.4"
watchOSVersion: "10.4"
iOSVersion: "18.0"
watchOSVersion: "11.0"
watchName: "Apple Watch Ultra 2 (49mm)"
iPhoneName: "iPhone 15 Pro Max"
steps:
Expand All @@ -99,7 +73,7 @@ jobs:
restore-keys: |
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
- name: Cache mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.0')
id: cache-mint
uses: actions/cache@v4
env:
Expand All @@ -116,7 +90,7 @@ jobs:
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
- name: Install mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.0')
run: |
brew update
brew install mint
Expand All @@ -138,7 +112,7 @@ jobs:
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.0')
- name: Run iOS target tests
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }}-Package -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
Expand Down Expand Up @@ -166,50 +140,4 @@ jobs:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }}
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
build-self:
name: Build on Self-Hosting macOS
runs-on: [self-hosted, macOS]
if: github.event.repository.owner.login == github.event.organization.login && !contains(github.event.head_commit.message, 'ci skip')
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
id: cache-spm-macos
uses: actions/cache@v4
env:
cache-name: cache-spm
with:
path: .build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache mint
id: cache-mint
uses: actions/cache@v4
env:
cache-name: cache-mint
with:
path: .mint
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Mintfile') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build
run: swift build
- name: Run Swift Package tests
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
with:
fail-on-empty-output: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: macOS,${{ env.XCODE_NAME }}
- name: Clean up spm build directory
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
Loading

0 comments on commit ebd379b

Please sign in to comment.