Skip to content

Commit b62432c

Browse files
[PM-13193] Create Xcode version file (#1029)
1 parent 0e113bf commit b62432c

File tree

3 files changed

+49
-8
lines changed

3 files changed

+49
-8
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ on:
6767
type: boolean
6868
env:
6969
BUILD_VARIANT: ${{ inputs.build-variant || 'Beta' }}
70-
XCODE_VERSION: ${{ inputs.xcode-version || '15.4' }}
70+
XCODE_VERSION: ${{ inputs.xcode-version }}
7171

7272
jobs:
7373
build:
@@ -126,17 +126,22 @@ jobs:
126126
content=$(cat version-info/version_info.json)
127127
echo "version_name=$(echo $content | jq -r .version_name)" >> $GITHUB_OUTPUT
128128
echo "version_number=$(echo $content | jq -r .version_number)" >> $GITHUB_OUTPUT
129+
129130
- name: Upload version info artifact
130131
if: ${{ inputs.upload_version_info }}
131132
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
132133
with:
133134
name: version-info
134135
path: version-info/version_info.json
135136

137+
- name: Read default Xcode version
138+
run: |
139+
echo "DEFAULT_XCODE_VERSION=$(cat .xcode-version | tr -d '\n')" >> "$GITHUB_ENV"
140+
136141
- name: Set Xcode version
137142
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
138143
with:
139-
xcode-version: ${{ env.XCODE_VERSION }}
144+
xcode-version: ${{ env.XCODE_VERSION || env.DEFAULT_XCODE_VERSION }}
140145

141146
- name: Cache Mint packages
142147
id: mint-cache

.github/workflows/test.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,37 @@ on:
88
- "hotfix-rc"
99
pull_request_target:
1010
types: [opened, synchronize]
11+
workflow_dispatch:
12+
inputs:
13+
xcode-version:
14+
description: "Xcode version override - e.g. '15.2'"
15+
type: string
16+
simulator-name:
17+
description: "Simulator name override - e.g. 'iPhone 16 Pro'"
18+
type: string
19+
simulator-version:
20+
description: "Simulator iOS version override - e.g. '18.0.1'"
21+
type: string
22+
workflow_call:
23+
inputs:
24+
xcode-version:
25+
description: "Xcode version override - e.g. '15.2'"
26+
type: string
27+
simulator-name:
28+
description: "Simulator name override - e.g. 'iPhone 16 Pro'"
29+
type: string
30+
simulator-version:
31+
description: "Simulator iOS version override - e.g. '18.0.1'"
32+
type: string
1133

1234
env:
13-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
35+
COVERAGE_PATH: build/coverage.xml
1436
MINT_LINK_PATH: .mint/bin
1537
MINT_PATH: .mint/lib
16-
SIMULATOR_DESTINATION: platform=iOS Simulator,name=iPhone 15 Pro,OS=17.0.1
1738
RESULT_BUNDLE_PATH: build/BitwardenTests.xcresult
18-
COVERAGE_PATH: build/coverage.xml
19-
XCODE_VERSION: 15.4
39+
SIMULATOR_NAME: ${{ inputs.simulator-name || 'iPhone 15 Pro' }}
40+
SIMULATOR_VERSION: ${{ inputs.simulator-version || '17.0.1' }}
41+
XCODE_VERSION: ${{ inputs.xcode-version }}
2042

2143
jobs:
2244
check-run:
@@ -33,15 +55,28 @@ jobs:
3355
pull-requests: write
3456

3557
steps:
58+
- name: Log inputs to job summary
59+
run: |
60+
echo "<details><summary>Build Workflow Inputs</summary>" >> $GITHUB_STEP_SUMMARY
61+
echo "" >> $GITHUB_STEP_SUMMARY
62+
echo '```json' >> $GITHUB_STEP_SUMMARY
63+
echo '${{ toJson(inputs) }}' >> $GITHUB_STEP_SUMMARY
64+
echo '```' >> $GITHUB_STEP_SUMMARY
65+
echo "</details>" >> $GITHUB_STEP_SUMMARY
66+
3667
- name: Check out repo
3768
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
3869
with:
3970
ref: ${{ github.event.pull_request.head.sha }}
4071

72+
- name: Read default Xcode version
73+
run: |
74+
echo "DEFAULT_XCODE_VERSION=$(cat .xcode-version | tr -d '\n')" >> "$GITHUB_ENV"
75+
4176
- name: Set Xcode version
4277
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
4378
with:
44-
xcode-version: ${{ env.XCODE_VERSION }}
79+
xcode-version: ${{ env.XCODE_VERSION || env.DEFAULT_XCODE_VERSION }}
4580

4681
- name: Configure Ruby
4782
uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1.194.0
@@ -82,7 +117,7 @@ jobs:
82117
-project Bitwarden.xcodeproj \
83118
-scheme Bitwarden \
84119
-configuration Debug \
85-
-destination "${{ env.SIMULATOR_DESTINATION }}" \
120+
-destination "platform=iOS Simulator,name=${{ env.SIMULATOR_NAME }},OS=${{ env.SIMULATOR_VERSION }}" \
86121
-resultBundlePath ${{ env.RESULT_BUNDLE_PATH }} \
87122
-derivedDataPath build/DerivedData \
88123
| xcbeautify --renderer github-actions

.xcode-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
15.4

0 commit comments

Comments
 (0)