From b4cfb65e60308793e17877339236ca51b519b1b7 Mon Sep 17 00:00:00 2001 From: Mathijs Bernson Date: Tue, 13 Jan 2026 22:39:31 +0100 Subject: [PATCH 1/2] Update GitHub Actions test workflow --- .github/workflows/test.yml | 65 ++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8b47c7b..3e7a97d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,37 +6,46 @@ on: pull_request: branches: [ "main" ] +env: + XCODE_VERSION: '26' + XCODE_PROJECT: "HackerTube.xcodeproj" + SCHEME: "HackerTube" + TEST_PLAN: UnitTests + TEST_RESULT_BUNDLE: "TestResults.xcresult" + + # iOS Simulator configuration + TEST_PLATFORM: 'iOS Simulator' + TEST_DEVICE_TYPE: 'iPhone 16' + jobs: build: name: Build and Test on iOS Simulator runs-on: macos-latest + env: - XCODE_PROJECT: "HackerTube.xcodeproj" - SCHEME: "HackerTube" - PLATFORM: 'iOS Simulator' - DEVICE: 'iPhone 16' - TEST_PLAN: UnitTests - TEST_RESULT_BUNDLE: "TestResults.xcresult" + TEST_DEVICE_NAME: 'TestDevice' + steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '26.0-beta' - - - name: Test - run: | - set -o pipefail && xcodebuild test \ - -project "${{ env.XCODE_PROJECT }}" \ - -scheme ${{ env.SCHEME }} \ - -testPlan "${{ env.TEST_PLAN }}" \ - -resultBundlePath "${{ env.TEST_RESULT_BUNDLE }}" \ - -destination "platform=${{ env.PLATFORM }},name=${{ env.DEVICE }}" | xcpretty - - - name: Upload test result bundle - uses: actions/upload-artifact@v4 - with: - name: ${{ env.SCHEME }}-${{ github.sha }}.xcresult - path: ${{ env.TEST_RESULT_BUNDLE }} + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ env.XCODE_VERSION }} + + - name: Test + run: | + xcodebuild test \ + -project "${{ env.XCODE_PROJECT }}" \ + -scheme ${{ env.SCHEME }} \ + -testPlan "${{ env.TEST_PLAN }}" \ + -resultBundlePath "${{ env.TEST_RESULT_BUNDLE }}" \ + -destination "platform=${{ env.TEST_PLATFORM }},name=${{ env.TEST_DEVICE_NAME }}" + + - name: Upload test result bundle + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: ${{ env.SCHEME }}-${{ env.TEST_PLAN }}-${{ github.sha }}.xcresult + path: ${{ env.TEST_RESULT_BUNDLE }} From 540f3269b5329a6b6b9f03a542d6990d52b588ad Mon Sep 17 00:00:00 2001 From: Mathijs Bernson Date: Tue, 13 Jan 2026 22:42:39 +0100 Subject: [PATCH 2/2] Create the iOS Simulator for testing --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e7a97d..c5483a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,10 @@ jobs: with: xcode-version: ${{ env.XCODE_VERSION }} + - name: Create iOS Simulator + run: | + xcrun simctl create "${{ env.TEST_DEVICE_NAME }}" "${{ env.TEST_DEVICE_TYPE }}" + - name: Test run: | xcodebuild test \