From 8532131efb0d991cf2d7c42e5d17b7d41286c7df Mon Sep 17 00:00:00 2001 From: Felix Herrmann Date: Sun, 3 Mar 2024 22:52:27 +0100 Subject: [PATCH] Modernize xcodebuild workflow --- .github/workflows/xcodebuild.yml | 77 +++++++++++--------------------- 1 file changed, 25 insertions(+), 52 deletions(-) diff --git a/.github/workflows/xcodebuild.yml b/.github/workflows/xcodebuild.yml index c612a7e..827d2d9 100644 --- a/.github/workflows/xcodebuild.yml +++ b/.github/workflows/xcodebuild.yml @@ -2,60 +2,33 @@ name: Xcode Build on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] workflow_dispatch: -env: - DEVELOPER_DIR: /Applications/Xcode_13.2.app/Contents/Developer jobs: - build-macos: - runs-on: macos-11 - + build: + name: Build Package + runs-on: macos-latest + strategy: + matrix: + destination: + - generic/platform=macOS + - generic/platform=macOS,variant=Mac Catalyst + - generic/platform=iOS + - generic/platform=tvOS + - generic/platform=watchOS steps: - - uses: actions/checkout@v2 - - name: Build macOS - run: xcodebuild -scheme UIImageColors-Package -destination 'platform=macOS' - - name: Run macOS tests - run: xcodebuild -scheme UIImageColors-Package -destination 'platform=macOS' test - - build-macos-catalyst: - runs-on: macos-11 - - steps: - - uses: actions/checkout@v2 - - name: Build macOS Catalyst - run: xcodebuild -scheme UIImageColors-Package -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' - - name: Run macOS Catalyst tests - run: xcodebuild -scheme UIImageColors-Package -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' test - - build-ios: - runs-on: macos-11 - - steps: - - uses: actions/checkout@v2 - - name: Build iOS - run: xcodebuild -scheme UIImageColors-Package -destination 'name=iPhone 12' - - name: Run iOS tests - run: xcodebuild -scheme UIImageColors-Package -destination 'name=iPhone 12' test - - build-tvos: - runs-on: macos-11 - - steps: - - uses: actions/checkout@v2 - - name: Build tvOS - run: xcodebuild -scheme UIImageColors-Package -destination 'name=Apple TV' - - name: Run tvOS tests - run: xcodebuild -scheme UIImageColors-Package -destination 'name=Apple TV' test - - build-watchos: - runs-on: macos-11 - - steps: - - uses: actions/checkout@v2 - - name: Build watchOS - run: xcodebuild -scheme UIImageColors-Package -destination 'name=Apple Watch Series 6 - 44mm' - - name: Run watchOS tests - run: xcodebuild -scheme UIImageColors-Package -destination 'name=Apple Watch Series 6 - 44mm' test + - uses: actions/checkout@v4 + - name: Build + run: | + xcodebuild \ + -scheme UIImageColors-Package \ + -destination '${{ matrix.destination }}' + - name: Test + run: | + xcodebuild \ + -scheme UIImageColors-Package \ + -destination '${{ matrix.destination }}' \ + test