From d842dae1750a1ff5ac7451bd2c42958eb17f08f1 Mon Sep 17 00:00:00 2001 From: Allan Lang Date: Sun, 29 Sep 2024 14:33:41 +0100 Subject: [PATCH] Fixing build issues (#117) * Revert "i dont think swift version was helping" This reverts commit 6560329afa74b5c1680d16277a333f531ecd153b. * Revert "peg to older swift" This reverts commit 4c715aad0303f994918883ecbbabd3b31d654a99. * Revert "peg to older xcode to speed things up" This reverts commit 239c10edd85fae70417c1042dd5a63cdcfae7828. * Pin to macos-14 runner; use Production env for test execution to ensure data availability * Fix readme language * Use checkout@v4 * Remove redundant stage build * Increase sync timeout to avoid flaky tests --- .github/workflows/build-release.yaml | 42 +++++++------------ README.md | 2 +- Unit Tests/ProtectEarthSiteServiceTests.swift | 2 +- .../ProtectEarthSpeciesServiceTests.swift | 2 +- .../ProtectEarthSupervisorServiceTests.swift | 2 +- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index ee358c7..a7fa5f7 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -9,21 +9,16 @@ on: jobs: test: name: Build and test - runs-on: macos-13 + runs-on: macos-14 environment: - name: Test + name: Production steps: - # Older xcode used to avoid timeouts in fastlane that were introduced by Xcode 15... - # https://github.com/orgs/community/discussions/68807 - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '14.3.1' - - name: Checkout uses: actions/checkout@v4 - - - name: Install Pouch - run: brew install sunshinejr/formulae/pouch + + - name: Install tools + run: | + brew install sunshinejr/formulae/pouch - name: Generate Secrets.swift env: @@ -47,26 +42,21 @@ jobs: set -o pipefail xcodebuild build-for-testing test -scheme "Unit Tests" -project "Tree Tracker.xcodeproj" -destination "platform=$platform,name=$device" | xcpretty - build-publish: - name: Build and Publish + build-publish-prod: + name: Build and publish - Production if: ${{ github.ref_name == 'main' && github.event_name != 'pull_request' }} - runs-on: macos-13 + runs-on: macos-14 needs: test environment: name: Production steps: - # Older xcode used to avoid timeouts in fastlane that were introduced by Xcode 15... - # https://github.com/orgs/community/discussions/68807 - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '14.3.1' - - name: Checkout uses: actions/checkout@v4 - - name: Install Pouch - run: brew install sunshinejr/formulae/pouch - + - name: Install tools + run: | + brew install sunshinejr/formulae/pouch + - name: Generate Secrets.swift env: AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} @@ -82,7 +72,7 @@ jobs: - name: Set build number run: agvtool new-version $GITHUB_RUN_NUMBER - + - name: Configure Keychain env: BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }} @@ -122,11 +112,11 @@ jobs: run: | set -o pipefail xcodebuild -archivePath ~/build/Tree\ Tracker.xcarchive -exportOptionsPlist $GITHUB_WORKSPACE/Tree\ Tracker/ExportOptions.plist -exportPath ~/build -allowProvisioningUpdates -exportArchive | xcpretty - + - name: Publish if: ${{ success() && github.ref_name == 'main' && github.event_name != 'pull_request' }} env: APPLEID_USERNAME: ${{ secrets.APPLE_APPLE_ID }} APPLEID_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} run: | - xcrun altool --upload-app -t ios -f ~/build/Tree\ Tracker.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose + xcrun altool --upload-app -t ios -f ~/build/Tree\ Tracker.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose \ No newline at end of file diff --git a/README.md b/README.md index a804c54..76119ed 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you wish, you can sign up for a free Rollbar account, generate your own API t If you choose not to setup Rollbar, simply add a dummy value for `ROLLBAR_AUTH_TOKEN` and any Rollbar calls will silently fail. ## Additional project config {#config} -Now, to run the project, we'll need to generate the Secrets file. This means you need to run first install [`pouch`](https://github.com/sunshinejr/pouch) (the easiest is using `brew install sunshinejr/formulae/pouch`). Now, you need to have these environment variables available. It would be wise to prepare this file once and keep it somewhere obvious but take care not to check it in to Git. You can simply `source` the file whenever you need to regenerate Secrets. +Now, to run the project, we'll need to generate the Secrets file. This means you need to first install [`pouch`](https://github.com/sunshinejr/pouch) (the easiest is using `brew install sunshinejr/formulae/pouch`). Now, you need to have these environment variables available. It would be wise to prepare this file once and keep it somewhere obvious but take care not to check it in to Git. You can simply `source` the file whenever you need to regenerate Secrets. ``` export AWS_BUCKET_NAME= diff --git a/Unit Tests/ProtectEarthSiteServiceTests.swift b/Unit Tests/ProtectEarthSiteServiceTests.swift index 6b7c021..25138a9 100644 --- a/Unit Tests/ProtectEarthSiteServiceTests.swift +++ b/Unit Tests/ProtectEarthSiteServiceTests.swift @@ -14,7 +14,7 @@ class ProtectEarthSiteServiceTests: XCTestCase { siteService!.sync() { _ in expectation.fulfill() } - waitForExpectations(timeout: 5) + waitForExpectations(timeout: 10) } override func tearDownWithError() throws { diff --git a/Unit Tests/ProtectEarthSpeciesServiceTests.swift b/Unit Tests/ProtectEarthSpeciesServiceTests.swift index e103b9b..483c585 100644 --- a/Unit Tests/ProtectEarthSpeciesServiceTests.swift +++ b/Unit Tests/ProtectEarthSpeciesServiceTests.swift @@ -14,7 +14,7 @@ class ProtectEarthSpeciesServiceTests: XCTestCase { speciesService!.sync() { _ in expectation.fulfill() } - waitForExpectations(timeout: 5) + waitForExpectations(timeout: 10) } override func tearDownWithError() throws { diff --git a/Unit Tests/ProtectEarthSupervisorServiceTests.swift b/Unit Tests/ProtectEarthSupervisorServiceTests.swift index ea78c26..f69ef06 100644 --- a/Unit Tests/ProtectEarthSupervisorServiceTests.swift +++ b/Unit Tests/ProtectEarthSupervisorServiceTests.swift @@ -14,7 +14,7 @@ class ProtectEarthSupervisorServiceTests: XCTestCase { supervisorService!.sync() { _ in expectation.fulfill() } - waitForExpectations(timeout: 5) + waitForExpectations(timeout: 10) } override func tearDownWithError() throws {