Skip to content

Commit

Permalink
Fixing build issues (#117)
Browse files Browse the repository at this point in the history
* Revert "i dont think swift version was helping"

This reverts commit 6560329.

* Revert "peg to older swift"

This reverts commit 4c715aa.

* Revert "peg to older xcode to speed things up"

This reverts commit 239c10e.

* 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
  • Loading branch information
allanlang authored Sep 29, 2024
1 parent 6560329 commit d842dae
Showing 5 changed files with 20 additions and 30 deletions.
42 changes: 16 additions & 26 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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=
2 changes: 1 addition & 1 deletion Unit Tests/ProtectEarthSiteServiceTests.swift
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class ProtectEarthSiteServiceTests: XCTestCase {
siteService!.sync() { _ in
expectation.fulfill()
}
waitForExpectations(timeout: 5)
waitForExpectations(timeout: 10)
}

override func tearDownWithError() throws {
2 changes: 1 addition & 1 deletion Unit Tests/ProtectEarthSpeciesServiceTests.swift
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class ProtectEarthSpeciesServiceTests: XCTestCase {
speciesService!.sync() { _ in
expectation.fulfill()
}
waitForExpectations(timeout: 5)
waitForExpectations(timeout: 10)
}

override func tearDownWithError() throws {
2 changes: 1 addition & 1 deletion Unit Tests/ProtectEarthSupervisorServiceTests.swift
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class ProtectEarthSupervisorServiceTests: XCTestCase {
supervisorService!.sync() { _ in
expectation.fulfill()
}
waitForExpectations(timeout: 5)
waitForExpectations(timeout: 10)
}

override func tearDownWithError() throws {

0 comments on commit d842dae

Please sign in to comment.