Skip to content

Commit 8062b4c

Browse files
authored
Update Github workflow build & run destinations, fix respective integration tests (#545)
All tests are updated to use macOS 15, Xcode 16.4, and iOS 18.6. This also requires an update to the integration tests, which were looking for a different title on the Password Manager field. Ordinarily, I would see "breakage due to macos-latest/default sims/default xcode" changing as a useful reminder to update our repo. Due to [an unfixed bug in the iOS 18.4 simulators](https://developer.apple.com/forums/thread/777999?page=4) and actions/runner-images#12758, using macOS-latest and the default simulators does not work. More on Github runtime updates: Github has actions/runner-images#12541 the latest three versions of the platform tools for Xcode. If the default Xcode runtime for a macOS image is not one of those, simulators won't be available. This is currently true of macOS-15, where Xcode 16.0 is the default. As such, we need to specify the Xcode version. I've specified the macOS version as well to ensure that version of Xcode is available.
1 parent 3996d90 commit 8062b4c

5 files changed

Lines changed: 34 additions & 21 deletions

File tree

.github/workflows/builds.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
os: [macos-latest]
18+
os: [macos-15]
1919

2020
steps:
2121
- uses: actions/checkout@v3
22+
- name: Select Xcode
23+
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
2224
- name: Archive for iOS
2325
run: |
2426
xcodebuild \

.github/workflows/integration_tests.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
fi
4848
4949
swift-button-functional-test:
50-
runs-on: macos-latest
50+
runs-on: macos-15
5151
needs: check-pr-body-for-key
5252
# Don't run if triggered by a PR from a fork since our Secrets won't be provided to the runner.
5353
if: ${{ needs.check-pr-body-for-key.outputs.RUN_INTEGRATION == 'yes' && !github.event.pull_request.head.repo.fork }}
@@ -57,14 +57,15 @@ jobs:
5757
steps:
5858
- name: Checkout
5959
uses: actions/checkout@v3
60+
- name: Select Xcode
61+
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
6062
- name: Build test target for Google Sign-in button for Swift
6163
run: |
6264
xcodebuild \
6365
-project DaysUntilBirthday.xcodeproj \
6466
build-for-testing \
6567
-scheme DaysUntilBirthday\ \(iOS\) \
6668
-sdk iphonesimulator \
67-
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4'
6869
- name: Run test target for Google Sign-in button for Swift
6970
env:
7071
EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }}
@@ -75,12 +76,12 @@ jobs:
7576
test-without-building \
7677
-scheme DaysUntilBirthday\ \(iOS\) \
7778
-sdk iphonesimulator \
78-
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \
79+
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.6' \
7980
EMAIL_SECRET=$EMAIL_SECRET \
8081
PASSWORD_SECRET=$PASSWORD_SECRET
8182
8283
app-check-api-token-tests:
83-
runs-on: macOS-13
84+
runs-on: macos-15
8485
# Don't run if triggered by a PR from a fork since our Secrets won't be provided to the runner.
8586
if: "!github.event.pull_request.head.repo.fork"
8687
defaults:
@@ -89,17 +90,15 @@ jobs:
8990
steps:
9091
- name: Checkout
9192
uses: actions/checkout@v3
92-
- name: Use Xcode 15.0.1
93-
run: |
94-
sudo xcode-select -s /Applications/Xcode_15.0.1.app
93+
- name: Select Xcode
94+
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
9595
- name: Build test target for App Check Example
9696
run: |
9797
xcodebuild \
9898
-project AppAttestExample.xcodeproj \
9999
build-for-testing \
100100
-scheme AppAttestExample \
101101
-sdk iphonesimulator \
102-
-destination 'platform=iOS Simulator,name=iPhone 15'
103102
- name: Run test target for App Check Example
104103
env:
105104
AppCheckDebugToken : ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
@@ -110,6 +109,6 @@ jobs:
110109
test-without-building \
111110
-scheme AppAttestExample \
112111
-sdk iphonesimulator \
113-
-destination 'platform=iOS Simulator,name=iPhone 15' \
112+
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.6' \
114113
AppCheckDebugToken=$AppCheckDebugToken \
115114
APP_CHECK_WEB_API_KEY=$APP_CHECK_WEB_API_KEY

.github/workflows/unit_tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
os: [macos-latest]
42+
os: [macos-15]
4343
sdk: ['macosx', 'iphonesimulator']
4444
include:
4545
- sdk: 'macosx'
4646
destination: '"platform=OS X,arch=x86_64"'
4747
- sdk: 'iphonesimulator'
48-
destination: '"platform=iOS Simulator,name=iPhone 15"'
48+
destination: '"platform=iOS Simulator,name=iPhone 16,OS=18.6"'
4949
steps:
5050
- uses: actions/checkout@v3
51+
- name: Select Xcode
52+
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
5153
- name: Build unit test target
5254
run: |
5355
xcodebuild \

Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class DaysUntilBirthdayUITests_iOS: XCTestCase {
2020
private let signInStaticText =
2121
"“DaysUntilBirthday (iOS)” Wants to Use “google.com” to Sign In"
2222
private let passwordManagerPrompt =
23-
"Would you like to save this password to use with apps and websites?"
23+
"Save Password?"
2424
private let signInDisclaimerHeaderText =
25-
"Sign in to Days Until Birthday"
25+
"Sign in to DaysUntilBirthday (iOS)"
2626
private let returningUserSignInDisclaimerHeaderText =
27-
"You’re signing back in to Days Until Birthday"
28-
private let additionalAccessHeaderText = "Days Until Birthday wants additional access to your Google Account"
29-
private let appTrustWarningText = "Make sure you trust Days Until Birthday"
27+
"You’re signing back in to DaysUntilBirthday (iOS)"
28+
private let additionalAccessHeaderText = "DaysUntilBirthday (iOS) wants additional access to your Google Account"
29+
private let appTrustWarningText = "Make sure you trust DaysUntilBirthday (iOS)"
3030
private let chooseAnAccountHeaderText = "Choose an account"
3131
private let notNowText = "Not Now"
3232
private let timeout: TimeInterval = 30
@@ -177,6 +177,7 @@ extension DaysUntilBirthdayUITests_iOS {
177177
// Proceed through sign-in disclaimer and/or access request view(s) if needed
178178
handleSignInDisclaimerIfNeeded()
179179
handleAccessRequestIfNeeded()
180+
handleReturningUserSignInDisclaimerIfNeeded()
180181

181182
return true
182183
}
@@ -191,8 +192,9 @@ extension DaysUntilBirthdayUITests_iOS {
191192
return false
192193
}
193194

194-
handleReturningUserSignInDisclaimerIfNeeded()
195+
handleSignInDisclaimerIfNeeded()
195196
handleAccessRequestIfNeeded()
197+
handleReturningUserSignInDisclaimerIfNeeded()
196198

197199
return true
198200
}

Samples/Swift/DaysUntilBirthday/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ The email and password that we use are defined as
3535
[secrets](https://docs.github.com/en/actions/learn-github-actions/contexts#secrets-context)
3636
on our GitHub repo, and we retrieve these from the workflow environment.
3737

38-
Locally, both the email and password need to be passed to `xcodebuild` as
39-
arguments: `xcodebuild <other args> EMAIL_SECRET=... PASSWORD_SECRET=...`.
40-
Refer to the repo's Secrets for these values.
38+
When run locally, both the email and password need to be passed to `xcodebuild`.
39+
40+
In Xcode, you can add arguments by selecting "Edit Scheme > Run > Environment Variables", and
41+
replace the variables with your test account. Alternatively, edit `Credential.swift` directly.
42+
WARNING: Don't check these into the repo!
43+
44+
From the command line, you can do this as arguments:
45+
`xcodebuild <other args> EMAIL_SECRET=... PASSWORD_SECRET=...`.
46+
47+
For Googlers, refer to CSI internal Workflow documentation for how to access these values, or access
48+
them via the repo's Secrets.

0 commit comments

Comments
 (0)