diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c900377f8..f84c77ddb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,7 @@ on: type: boolean env: BUILD_VARIANT: ${{ inputs.build-variant || 'Beta' }} - XCODE_VERSION: ${{ inputs.xcode-version || '15.4' }} + XCODE_VERSION: ${{ inputs.xcode-version }} jobs: build: @@ -126,6 +126,7 @@ jobs: content=$(cat version-info/version_info.json) echo "version_name=$(echo $content | jq -r .version_name)" >> $GITHUB_OUTPUT echo "version_number=$(echo $content | jq -r .version_number)" >> $GITHUB_OUTPUT + - name: Upload version info artifact if: ${{ inputs.upload_version_info }} uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 @@ -133,10 +134,14 @@ jobs: name: version-info path: version-info/version_info.json + - name: Read default Xcode version + run: | + echo "DEFAULT_XCODE_VERSION=$(cat .xcode-version | tr -d '\n')" >> "$GITHUB_ENV" + - name: Set Xcode version uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: - xcode-version: ${{ env.XCODE_VERSION }} + xcode-version: ${{ env.XCODE_VERSION || env.DEFAULT_XCODE_VERSION }} - name: Cache Mint packages id: mint-cache diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d37d93272..4b65f9e91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,15 +8,37 @@ on: - "hotfix-rc" pull_request_target: types: [opened, synchronize] + workflow_dispatch: + inputs: + xcode-version: + description: "Xcode version override - e.g. '15.2'" + type: string + simulator-name: + description: "Simulator name override - e.g. 'iPhone 16 Pro'" + type: string + simulator-version: + description: "Simulator iOS version override - e.g. '18.0.1'" + type: string + workflow_call: + inputs: + xcode-version: + description: "Xcode version override - e.g. '15.2'" + type: string + simulator-name: + description: "Simulator name override - e.g. 'iPhone 16 Pro'" + type: string + simulator-version: + description: "Simulator iOS version override - e.g. '18.0.1'" + type: string env: - DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer + COVERAGE_PATH: build/coverage.xml MINT_LINK_PATH: .mint/bin MINT_PATH: .mint/lib - SIMULATOR_DESTINATION: platform=iOS Simulator,name=iPhone 15 Pro,OS=17.0.1 RESULT_BUNDLE_PATH: build/BitwardenTests.xcresult - COVERAGE_PATH: build/coverage.xml - XCODE_VERSION: 15.4 + SIMULATOR_NAME: ${{ inputs.simulator-name || 'iPhone 15 Pro' }} + SIMULATOR_VERSION: ${{ inputs.simulator-version || '17.0.1' }} + XCODE_VERSION: ${{ inputs.xcode-version }} jobs: check-run: @@ -33,15 +55,28 @@ jobs: pull-requests: write steps: + - name: Log inputs to job summary + run: | + echo "
Build Workflow Inputs" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```json' >> $GITHUB_STEP_SUMMARY + echo '${{ toJson(inputs) }}' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "
" >> $GITHUB_STEP_SUMMARY + - name: Check out repo uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Read default Xcode version + run: | + echo "DEFAULT_XCODE_VERSION=$(cat .xcode-version | tr -d '\n')" >> "$GITHUB_ENV" + - name: Set Xcode version uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: - xcode-version: ${{ env.XCODE_VERSION }} + xcode-version: ${{ env.XCODE_VERSION || env.DEFAULT_XCODE_VERSION }} - name: Configure Ruby uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1.194.0 @@ -82,7 +117,7 @@ jobs: -project Bitwarden.xcodeproj \ -scheme Bitwarden \ -configuration Debug \ - -destination "${{ env.SIMULATOR_DESTINATION }}" \ + -destination "platform=iOS Simulator,name=${{ env.SIMULATOR_NAME }},OS=${{ env.SIMULATOR_VERSION }}" \ -resultBundlePath ${{ env.RESULT_BUNDLE_PATH }} \ -derivedDataPath build/DerivedData \ | xcbeautify --renderer github-actions diff --git a/.xcode-version b/.xcode-version new file mode 100644 index 000000000..232a7fc1a --- /dev/null +++ b/.xcode-version @@ -0,0 +1 @@ +15.4