From 91c11a7180a3da161059641d36306489efe99b71 Mon Sep 17 00:00:00 2001 From: Sean Cheong Zhen Xiong Date: Thu, 14 Aug 2025 08:58:46 +0900 Subject: [PATCH 1/2] chore: Setup CI workflow --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0b3123e --- /dev/null +++ b/.github/workflows/ci.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: Continuous Integration + +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 471cfeb61f2970bd09fb34dc0c4be3c1aa377115 Mon Sep 17 00:00:00 2001 From: Sean Cheong Zhen Xiong Date: Thu, 14 Aug 2025 09:06:44 +0900 Subject: [PATCH 2/2] Update ci.yml to use xcodebuild --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b3123e..3458b93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,3 @@ -# 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: Continuous Integration on: @@ -10,13 +7,38 @@ on: branches: [ "main" ] jobs: - build: - + build-and-test: runs-on: macos-latest steps: - - uses: actions/checkout@v4 - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v + - uses: actions/checkout@v4 + + # See https://github.com/maxim-lobanov/setup-xcode#readme for versions + - name: Select Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "16" + + # Build for testing (no code signing) + - name: Build for testing + run: | + xcodebuild \ + -scheme "SampleNews" \ + -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \ + -configuration Debug \ + -skipPackagePluginValidation \ + -allowProvisioningUpdates \ + CODE_SIGNING_ALLOWED=NO \ + build-for-testing + + # Run tests without rebuilding + - name: Run tests + run: | + xcodebuild \ + -scheme "SampleNews" \ + -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \ + -configuration Debug \ + -skipPackagePluginValidation \ + -allowProvisioningUpdates \ + CODE_SIGNING_ALLOWED=NO \ + test-without-building