-
-
Notifications
You must be signed in to change notification settings - Fork 4
vagrant user #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vagrant user #150
Changes from all commits
8fcd032
1740194
8345539
c9d60ff
2cd4ab1
7492c2c
6494330
00182a5
90100fc
e0dca42
4f960df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ inputs: | |
| ruby-version: | ||
| description: Ruby version to use (only for iOS) | ||
| required: false | ||
| default: '3.1' | ||
| default: '3.2' | ||
| xcode-version: | ||
| description: Xcode version to select (e.g., 16.3) | ||
| required: false | ||
|
|
@@ -89,6 +89,19 @@ runs: | |
| - run: echo "Setup E2E Environment started" | ||
| shell: bash | ||
|
|
||
| # Set user path for Bitrise vagrant user | ||
| - name: Set user paths for Bitrise runner | ||
| run: | | ||
| echo "USER_HOME=/Users/vagrant" >> "$GITHUB_ENV" | ||
| echo "HOME=/Users/vagrant" >> "$GITHUB_ENV" | ||
| echo "RUNNER_TOOL_CACHE=/Users/vagrant/hostedtoolcache" >> "$GITHUB_ENV" | ||
| echo "RUNNER_TEMP=/Users/vagrant/tmp" >> "$GITHUB_ENV" | ||
| # Create the directories if they don't exist | ||
| mkdir -p /Users/vagrant/hostedtoolcache | ||
| mkdir -p /Users/vagrant/tmp | ||
| echo "Using hardcoded vagrant user path: /Users/vagrant" | ||
| shell: bash | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Bitrise Runner Paths Fail on LinuxThe "Set user paths for Bitrise runner" step runs unconditionally, hardcoding macOS-specific paths ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Bitrise Runner Paths Fail on Non-macOSThe "Set user paths for Bitrise runner" step runs unconditionally, setting environment variables and creating directories with hardcoded There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Bitrise Runner Paths Fail on LinuxThe "Set user paths for Bitrise runner" step unconditionally sets |
||
|
|
||
| ## Android Setup (early for fail-fast) ## | ||
|
|
||
| # Set Android environment variables (self-hosted runner has SDK pre-installed) | ||
|
|
@@ -146,8 +159,8 @@ runs: | |
| if: ${{ inputs.platform == 'android'}} | ||
| shell: bash | ||
| run: | | ||
| echo "ANDROID_AVD_HOME=$HOME/.android/avd" >> "$GITHUB_ENV" | ||
| mkdir -p "$HOME/.android/avd" | ||
| echo "ANDROID_AVD_HOME=$USER_HOME/.android/avd" >> "$GITHUB_ENV" | ||
| mkdir -p "$USER_HOME/.android/avd" | ||
|
|
||
| - name: Create Android Virtual Device (AVD) | ||
| if: ${{ inputs.platform == 'android'}} | ||
|
|
@@ -223,7 +236,7 @@ runs: | |
| run: | | ||
| echo "Installing Foundry via foundryup..." | ||
|
|
||
| export FOUNDRY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/.foundry" | ||
| export FOUNDRY_DIR="${XDG_CONFIG_HOME:-$USER_HOME/.config}/.foundry" | ||
| export FOUNDRY_BIN="$FOUNDRY_DIR/bin" | ||
|
|
||
| mkdir -p "$FOUNDRY_BIN" | ||
|
|
@@ -238,19 +251,77 @@ runs: | |
| ## IOS Setup ## | ||
|
|
||
| ## Ruby Setup & Cache Management | ||
| - name: Setup Ruby | ||
| - name: Setup Ruby (use system Ruby for vagrant user) | ||
| if: ${{ inputs.platform == 'ios' }} | ||
| uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 | ||
| with: | ||
| ruby-version: ${{ inputs.ruby-version }} | ||
|
|
||
| # Install Bundler first | ||
| - name: Install bundler | ||
| if: ${{ inputs.platform == 'ios' }} | ||
| run: gem install bundler -v ${{ inputs.bundler-version }} | ||
| working-directory: ios | ||
| run: | | ||
| # Use system Ruby instead of ruby/setup-ruby action to avoid permission issues | ||
| echo "Using system Ruby for vagrant user" | ||
|
|
||
| # Check if rbenv is being used and set Ruby version | ||
| if command -v rbenv &> /dev/null; then | ||
| echo "rbenv detected, checking available Ruby versions" | ||
| rbenv versions | ||
|
|
||
| # Map requested version to available version on Bitrise stack | ||
| REQUESTED_VERSION="${{ inputs.ruby-version }}" | ||
|
|
||
| # Check if .ruby-version file exists and has a full version | ||
| if [ -f ".ruby-version" ]; then | ||
| EXISTING_VERSION=$(cat .ruby-version | tr -d '\n' | tr -d ' ') | ||
| echo "Found .ruby-version file with version: $EXISTING_VERSION" | ||
|
|
||
| # Check if the version from .ruby-version is available | ||
| if rbenv versions --bare | grep -q "^${EXISTING_VERSION}$"; then | ||
| RUBY_VERSION="$EXISTING_VERSION" | ||
| echo "Using Ruby version from .ruby-version: $RUBY_VERSION" | ||
| else | ||
| echo "Ruby $EXISTING_VERSION from .ruby-version is not installed" | ||
| echo "Available versions:" | ||
| rbenv versions | ||
| # Fall back to mapping logic below | ||
| fi | ||
| fi | ||
|
|
||
| # If RUBY_VERSION not set, map requested version to available | ||
| if [ -z "$RUBY_VERSION" ]; then | ||
| if [ "$REQUESTED_VERSION" = "3.1" ]; then | ||
| RUBY_VERSION="3.2.9" | ||
| echo "Mapping 3.1 -> 3.2.9 (3.1.x not available)" | ||
| elif [ "$REQUESTED_VERSION" = "3.2" ]; then | ||
| RUBY_VERSION="3.2.9" | ||
| echo "Using available Ruby 3.2.9" | ||
| elif [ "$REQUESTED_VERSION" = "3.3" ]; then | ||
| RUBY_VERSION="3.3.9" | ||
| echo "Using available Ruby 3.3.9" | ||
| elif [ "$REQUESTED_VERSION" = "3.4" ]; then | ||
| RUBY_VERSION="3.4.5" | ||
| echo "Using available Ruby 3.4.5" | ||
| else | ||
| RUBY_VERSION="$REQUESTED_VERSION" | ||
| fi | ||
| fi | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Ruby Version Override Without WarningThe Ruby setup step silently substitutes the requested |
||
|
|
||
| echo "Setting Ruby version to: $RUBY_VERSION" | ||
|
|
||
| # Update .ruby-version file to ensure consistency | ||
| if [ -f ".ruby-version" ]; then | ||
| echo "Backing up and updating .ruby-version file" | ||
| cp .ruby-version .ruby-version.backup | ||
| echo "$RUBY_VERSION" > .ruby-version | ||
| fi | ||
| rbenv global "$RUBY_VERSION" | ||
| # Reload rbenv | ||
| eval "$(rbenv init -)" | ||
| fi | ||
|
|
||
| ruby --version | ||
| gem --version | ||
| # Install bundler globally | ||
| gem install bundler -v ${{ inputs.bundler-version }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: GitHub Actions Shell Initialization IssueThe |
||
| shell: bash | ||
|
|
||
| # Install Bundler first (now handled in Ruby setup step above) | ||
|
|
||
| # Restore cached Ruby gems | ||
| - name: Restore Bundler cache | ||
| if: ${{ inputs.platform == 'ios' }} | ||
|
|
@@ -278,7 +349,6 @@ runs: | |
| - name: Generate binstubs for CocoaPods | ||
| if: ${{ inputs.platform == 'ios' }} | ||
| run: bundle binstubs cocoapods --force --path=vendor/bundle/bin | ||
|
|
||
| working-directory: ios | ||
| shell: bash | ||
|
|
||
|
|
@@ -308,7 +378,32 @@ runs: | |
| # Select Xcode version | ||
| - name: Select Xcode version | ||
| if: ${{ inputs.platform == 'ios' }} | ||
| run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app | ||
| run: | | ||
| # Check available Xcode versions | ||
| echo "Available Xcode versions:" | ||
| ls -la /Applications/ | grep -i xcode || echo "No Xcode apps found in /Applications/" | ||
|
|
||
| # Try to find the correct Xcode path | ||
| REQUESTED_VERSION="${{ inputs.xcode-version }}" | ||
| if [ -d "/Applications/Xcode_${REQUESTED_VERSION}.app" ]; then | ||
| XCODE_PATH="/Applications/Xcode_${REQUESTED_VERSION}.app" | ||
| elif [ -d "/Applications/Xcode.app" ]; then | ||
| XCODE_PATH="/Applications/Xcode.app" | ||
| echo "Using default Xcode.app since Xcode_${REQUESTED_VERSION}.app not found" | ||
| else | ||
| # Find any available Xcode version | ||
| XCODE_PATH=$(find /Applications -name "Xcode*.app" -type d | head -1) | ||
| if [ -n "$XCODE_PATH" ]; then | ||
| echo "Using available Xcode: $XCODE_PATH" | ||
| else | ||
| echo "No Xcode installation found" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| echo "Setting Xcode path to: $XCODE_PATH" | ||
| sudo xcode-select -s "$XCODE_PATH" | ||
| xcode-select -p | ||
| shell: bash | ||
|
|
||
| # Restore CocoaPods cache | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Cross-Platform Path Issue Affects AVD and Foundry
Hardcoding
USER_HOMEto/Users/vagrant, a macOS-specific path, unconditionally replaces the dynamic$HOMEvariable. This causes Android AVD setup and Foundry installation to fail on Linux runners, used for Android E2E tests, because the path does not exist on Linux.