Adding Github Test Actions #2
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 uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# GitHub recommends pinning actions to a commit SHA. | |
# To get a newer version, you will need to update the SHA. | |
# You can also reference a tag or branch, but the action may change without warning. | |
name: Swift Unit Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
push: | |
branches: | |
- main | |
- develop | |
tags: | |
- '*' # Push events to every tag | |
jobs: | |
swift_tests_latest: | |
name: Latest Swift | |
runs-on: macos-15 | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: "16.0" | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: .build | |
key: macos-latest-spm-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
macos-latest-spm- | |
- name: Build | |
run: swift build | |
- name: Run tests | |
run: swift test --filter OSLogClientTests | |
swift_tests_previous: | |
name: Swift 5.10 | |
runs-on: macos-14 | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: "15.0" | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: .build | |
key: macos-14-swift-510-spm-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
macos-14-swift-510-spm- | |
- name: Build | |
run: swift build | |
- name: Run tests | |
run: swift test | |
swift_tests_legacy: | |
name: Swift ${{ matrix.swift }} | |
strategy: | |
matrix: | |
os: [macos-13] | |
swift: ["5.9", "5.8", "5.7"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: ${{ matrix.swift }} | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: "14.3.1" | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: .build | |
key: ${{ matrix.os }}-${{ matrix.swift }}-spm-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ matrix.os }}-spm- | |
- name: Build | |
run: swift build | |
- name: Run tests | |
run: swift test --filter OSLogClientTests | |
integration_tests: | |
name: Integration Tests (${{ matrix.destination }}) | |
strategy: | |
matrix: | |
os: [macos-15] | |
destination: ["platform=macOS", "name=iPhone 16", "name=iPad Pro 13-inch (M4)", "name=Apple Watch SE (44mm) (2nd generation)", "name=Apple Tv 4K (3rd Generation)", "name=Apple Vision Pro"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: "16.0" | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: .build | |
key: ${{ matrix.os }}-spm-${{ matrix.destinationName }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ matrix.os }}-spm-${{ matrix.destinationName }}- | |
- name: Build | |
run: xcodebuild build-for-testing -scheme OSLogClientIntegrationTests -destination "${{ matrix.destination }}" | |
- name: Test | |
run: xcodebuild test -scheme OSLogClientIntegrationTests -destination "${{ matrix.destination }}" -enableCodeCoverage YES |