From 92a008800cd7f421beb1a99bc6dae2cbe450eeb4 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Fri, 6 Dec 2024 12:01:31 +0100 Subject: [PATCH 1/6] Remove hack around apple-pay capability for macOS --- .github/workflows/cd.yml | 4 ---- .github/workflows/ci.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d1e43276..c47b1c3f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -52,10 +52,6 @@ jobs: - name: Install python dependencies run: pip install pyyaml==6.0.1 - - name: Remove Apple Pay capability for macOS - if: matrix.platform == 'macOS' - run: sed -i '' '/in-app-payments/d' project.yml - - name: Set VERSION from code shell: python run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d0fe5b6..33fd0005 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,10 +41,6 @@ jobs: if: matrix.platform == 'iOS' run: echo "EXTRA_XCODEBUILD=-sdk iphoneos ${{ env.APPLE_AUTH_PARAMS }}" >> $GITHUB_ENV - - name: Remove Apple Pay capability for macOS - if: matrix.platform == 'macOS' - run: sed -i '' '/in-app-payments/d' project.yml - - name: Build uses: ./.github/actions/xcbuild with: From 24dd8ef718c1aceef01608fd8d7dfed3b2fb3bc5 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 8 Dec 2024 11:22:18 +0100 Subject: [PATCH 2/6] Add authentication for macOS --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33fd0005..1016de0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,13 +34,16 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: Add Apple Store Key - if: matrix.platform == 'iOS' run: echo "${{ secrets.APPLE_STORE_AUTH_KEY }}" | base64 --decode -o ${{ env.APPLE_STORE_AUTH_KEY_PATH}} - - name: Set EXTRA_XCODEBUILD + - name: Set EXTRA_XCODEBUILD for iOS if: matrix.platform == 'iOS' run: echo "EXTRA_XCODEBUILD=-sdk iphoneos ${{ env.APPLE_AUTH_PARAMS }}" >> $GITHUB_ENV + - name: Set EXTRA_XCODEBUILD for macOS + if: matrix.platform == 'macOS' + run: echo "EXTRA_XCODEBUILD=${{ env.APPLE_AUTH_PARAMS }}" >> $GITHUB_ENV + - name: Build uses: ./.github/actions/xcbuild with: From b0e666a4b9b33b1a71d4a5389a47be6dce12797b Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 8 Dec 2024 11:30:36 +0100 Subject: [PATCH 3/6] Add authentication to tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1016de0e..1f15a54a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: - name: Run Unit Tests on macOS if: matrix.platform == 'macOS' - run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' + run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' ${EXTRA_XCODEBUILD} - name: Upload code coverage uses: codecov/codecov-action@v4.2.0 From d49d3efaf9d6084703528e721014f69316df15dd Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 8 Dec 2024 11:48:48 +0100 Subject: [PATCH 4/6] Remove in app payments for unit tests on macOS --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f15a54a..5547ed9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,9 +58,15 @@ jobs: if: matrix.platform == 'iOS' run: xcodebuild test -scheme Kiwix -destination 'platform=iOS Simulator,name=iPhone 15 Plus' + - name: Prepare running unit tests on macOS + if: matrix.platform == 'macOS' + run: | + sed -i '' '/in-app-payments/d' project.yml + xcodegen + - name: Run Unit Tests on macOS if: matrix.platform == 'macOS' - run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' ${EXTRA_XCODEBUILD} + run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' - name: Upload code coverage uses: codecov/codecov-action@v4.2.0 From 416701985d916b3284528fac34162f936f50fa56 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 8 Dec 2024 11:59:08 +0100 Subject: [PATCH 5/6] Update description, use only-testing for unit tests --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5547ed9e..cc58c5f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,9 +56,9 @@ jobs: - name: Run Unit Tests on iOS if: matrix.platform == 'iOS' - run: xcodebuild test -scheme Kiwix -destination 'platform=iOS Simulator,name=iPhone 15 Plus' + run: xcodebuild test -scheme Kiwix -only-testing -destination 'platform=iOS Simulator,name=iPhone 15 Plus' - - name: Prepare running unit tests on macOS + - name: Remove in-app-payments capability for unit tests on macOS if: matrix.platform == 'macOS' run: | sed -i '' '/in-app-payments/d' project.yml @@ -66,7 +66,7 @@ jobs: - name: Run Unit Tests on macOS if: matrix.platform == 'macOS' - run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' + run: xcodebuild test -scheme Kiwix -only-testing -destination 'platform=macOS' - name: Upload code coverage uses: codecov/codecov-action@v4.2.0 From d4cf6e2dd956013ced7e426796c8572e6e38df84 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 8 Dec 2024 16:42:26 +0100 Subject: [PATCH 6/6] Remove only-testing argument --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc58c5f3..9184f619 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - name: Run Unit Tests on iOS if: matrix.platform == 'iOS' - run: xcodebuild test -scheme Kiwix -only-testing -destination 'platform=iOS Simulator,name=iPhone 15 Plus' + run: xcodebuild test -scheme Kiwix -destination 'platform=iOS Simulator,name=iPhone 15 Plus' - name: Remove in-app-payments capability for unit tests on macOS if: matrix.platform == 'macOS' @@ -66,7 +66,7 @@ jobs: - name: Run Unit Tests on macOS if: matrix.platform == 'macOS' - run: xcodebuild test -scheme Kiwix -only-testing -destination 'platform=macOS' + run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' - name: Upload code coverage uses: codecov/codecov-action@v4.2.0