From 7aa236f8c08ccba84db649b8b1928798f1ae65ce Mon Sep 17 00:00:00 2001 From: MING <54872601+1998code@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:22:37 +0800 Subject: [PATCH 1/6] Try Swift Actions --- .github/workflows/swift.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/swift.yml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 0000000..21ae770 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,22 @@ +# This workflow will build a Swift project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift + +name: Swift + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: Build + run: swift build -v + - name: Run tests + run: swift test -v From 50663ca5fe3985e1a1840189d58722dd0e053bf1 Mon Sep 17 00:00:00 2001 From: MING <54872601+1998code@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:30:53 +0800 Subject: [PATCH 2/6] Fix swift.yml --- .github/workflows/swift.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 21ae770..e72d8ee 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -16,6 +16,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Swift using Swiftly + run: | + curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg + sudo installer -pkg swiftly.pkg -target / + export PATH="/usr/local/bin:$PATH" + swiftly init --quiet-shell-followup + . ~/.swiftly/env.sh + swiftly install 6.1 + swift --version - name: Build run: swift build -v - name: Run tests From 7ed4f75fbd1a2bfa2a79b2d75ee3a3d92857c929 Mon Sep 17 00:00:00 2001 From: MING <54872601+1998code@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:33:32 +0800 Subject: [PATCH 3/6] Retry Swift Actions --- .github/workflows/swift.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index e72d8ee..246ec55 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -18,12 +18,16 @@ jobs: - uses: actions/checkout@v4 - name: Install Swift using Swiftly run: | + # Download Swiftly package curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg - sudo installer -pkg swiftly.pkg -target / - export PATH="/usr/local/bin:$PATH" - swiftly init --quiet-shell-followup - . ~/.swiftly/env.sh + # Install to the current user's home directory to avoid permission issues + installer -pkg swiftly.pkg -target CurrentUserHomeDirectory + # Initialize Swiftly in the user's environment + ~/.swiftly/bin/swiftly init --quiet-shell-followup + source ~/.swiftly/env.sh + # Install Swift 6.1 swiftly install 6.1 + # Verify installation swift --version - name: Build run: swift build -v From 84862b1322ce0c7e58910a389a0c1f7ca1dbd391 Mon Sep 17 00:00:00 2001 From: MING <54872601+1998code@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:37:21 +0800 Subject: [PATCH 4/6] Update swift.yml --- .github/workflows/swift.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 246ec55..32cb61f 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -16,19 +16,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Swift using Swiftly - run: | - # Download Swiftly package - curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg - # Install to the current user's home directory to avoid permission issues - installer -pkg swiftly.pkg -target CurrentUserHomeDirectory - # Initialize Swiftly in the user's environment - ~/.swiftly/bin/swiftly init --quiet-shell-followup - source ~/.swiftly/env.sh - # Install Swift 6.1 - swiftly install 6.1 - # Verify installation - swift --version + - name: Setup Swift + uses: sersoft-gmbh/swifty-linux-action@v3 + with: + release-version: 6.1 - name: Build run: swift build -v - name: Run tests From ef0427ddd112aa685ee8807f3963a25faa2717c4 Mon Sep 17 00:00:00 2001 From: MING <54872601+1998code@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:38:43 +0800 Subject: [PATCH 5/6] Change to linux-based --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 32cb61f..964182a 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: ubuntu-latest # Changed from macos-latest to ubuntu-latest steps: - uses: actions/checkout@v4 From e83ea09391f70d7776b6cd241c052b46587c257b Mon Sep 17 00:00:00 2001 From: MING <54872601+1998code@users.noreply.github.com> Date: Mon, 21 Apr 2025 01:43:57 +0800 Subject: [PATCH 6/6] Revert to macOS --- .github/workflows/swift.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 964182a..4f404ee 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -10,17 +10,15 @@ on: branches: [ "main" ] jobs: - build: - - runs-on: ubuntu-latest # Changed from macos-latest to ubuntu-latest - + xcode: + runs-on: macos-15 + env: + DEVELOPER_DIR: /Applications/Xcode_16.3.app/Contents/Developer steps: - - uses: actions/checkout@v4 - - name: Setup Swift - uses: sersoft-gmbh/swifty-linux-action@v3 - with: - release-version: 6.1 - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v + - uses: actions/checkout@v4 + - name: Version + run: swift --version + - name: Build + run: swift build -v + - name: Test + run: swift test -v