diff --git a/.github/actions/xcode-select/action.yml b/.github/actions/xcode-select/action.yml new file mode 100644 index 000000000..80744df65 --- /dev/null +++ b/.github/actions/xcode-select/action.yml @@ -0,0 +1,9 @@ +name: "Configure: Xcode version" + +runs: + using: "composite" + steps: + - name: "Configure: Xcode version" + shell: bash + # for Xcode path, see https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode + run: echo "DEVELOPER_DIR=/Applications/Xcode_15.0.app" >> $GITHUB_ENV diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index df6631db1..2598d91a6 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -11,13 +11,18 @@ on: jobs: build: - runs-on: macos-13 + runs-on: macos-latest steps: - - name: List Xcode installations - run: sudo ls -1 /Applications | grep "Xcode" - - name: Select Xcode 15.1 - run: sudo xcode-select -s /Applications/Xcode_15.1.app/Contents/Developer - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v + - name: Select Xcode version + uses: ./.github/actions/xcode-select + - uses: actions/checkout@v3 + - uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf + with: + swift-version: "5.8" + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.0' + - name: Build + run: swift build -v + - name: Run tests + run: swift test -v \ No newline at end of file