chore: better swift-tools explanation #72
Workflow file for this run
This file contains hidden or 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
name: Test | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
branches: | |
- main | |
jobs: | |
load-env: | |
uses: ./.github/workflows/load-env.yml | |
test: | |
needs: 'load-env' | |
env: | |
package_name: ${{ needs.load-env.outputs.package-name }} | |
strategy: | |
matrix: | |
include: | |
- os: ${{ needs.load-env.outputs.macOS-runner-os }} | |
build-system: swift | |
swift-version: ${{ needs.load-env.outputs.swift-version }} | |
xcode-version: ${{ needs.load-env.outputs.xcode-version }} | |
- os: ubuntu-latest | |
build-system: swift | |
swift-version: ${{ needs.load-env.outputs.swift-version }} | |
- os: ${{ needs.load-env.outputs.macOS-runner-os }} | |
build-system: xcodebuild | |
xcode-version: ${{ needs.load-env.outputs.xcode-version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Select Swift Version | |
uses: ./.github/workflows/templates/select-swift-version/ | |
with: | |
xcode-version: ${{ matrix.xcode-version }} | |
swift-version: ${{ matrix.swift-version }} | |
- name: Cache Swift Packages | |
uses: ./.github/workflows/templates/swift-cache/ | |
with: | |
package-name: ${{ env.package_name }} | |
build-system: ${{ matrix.build-system }} | |
- name: Build with Swift Package Manager | |
if: matrix.build-system == 'swift' | |
run: swift build | |
- name: Test with Swift Package Manager | |
if: matrix.build-system == 'swift' | |
run: swift test | |
- name: Build with Xcodebuild | |
if: matrix.build-system == 'xcodebuild' | |
run: | | |
xcodebuild \ | |
-scheme ${{ env.package_name }} \ | |
-destination 'platform=macOS' \ | |
-derivedDataPath DerivedData \ | |
-collect-test-diagnostics never \ | |
RUN_CLANG_STATIC_ANALYZER=NO \ | |
COMPILER_INDEX_STORE_ENABLE=NO \ | |
build-for-testing | |
- name: Test with Xcodebuild | |
if: matrix.build-system == 'xcodebuild' | |
run: | | |
xcodebuild \ | |
-scheme ${{ env.package_name }} \ | |
-destination 'platform=macOS' \ | |
-derivedDataPath DerivedData \ | |
-collect-test-diagnostics never \ | |
RUN_CLANG_STATIC_ANALYZER=NO \ | |
COMPILER_INDEX_STORE_ENABLE=NO \ | |
test |