From d42ba0d7202e899fa5ab5923890388b118c401cd Mon Sep 17 00:00:00 2001 From: yaochenfeng <282696845@qq.com> Date: Mon, 9 Jun 2025 22:05:23 +0800 Subject: [PATCH] feat: --- .github/workflows/swift.yml | 38 ------------------------------------- .github/workflows/test.yml | 26 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/swift.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml deleted file mode 100644 index 4cda4b0..0000000 --- a/.github/workflows/swift.yml +++ /dev/null @@ -1,38 +0,0 @@ -# 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: - name: Swift on macos-latest - # strategy: - # matrix: - # platform: [macOS, iOS, tvOS, watchOS] - # include: - # - platform: macOS - # destination: 'generic/platform=macOS' - # test_cmd: 'swift test' - # - platform: iOS - # destination: 'platform=iOS Simulator,name=iPhone 14' - # test_cmd: 'xcodebuild -scheme DFService test' - # - platform: tvOS - # destination: 'platform=tvOS Simulator,name=Apple TV 4K' - # test_cmd: 'xcodebuild -scheme DFService test' - # - platform: watchOS - # destination: 'platform=watchOS Simulator,name=Apple Watch Series 7' - # test_cmd: 'xcodebuild -scheme DFService test' - # os: [macos-12,macos-latest] - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f739efc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test on macOS and Linux + +on: + push: + branches: [main, dev] + pull_request: + branches: [main, dev] + +jobs: + macos: + name: Test on macOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Run Tests (macOS) + run: swift test --enable-code-coverage + + linux: + name: Test on Linux + runs-on: ubuntu-latest + container: + image: swift:5.10 + steps: + - uses: actions/checkout@v3 + - name: Run Tests (Linux) + run: swift test