Skip to content

Connect device only once on UI #293

Connect device only once on UI

Connect device only once on UI #293

Workflow file for this run

name: publish-cli
on:
push:
branches:
- main
tags:
- '**'
pull_request:
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx6g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup JBR 17
uses: gmitch215/setup-java@main
with:
distribution: 'jetbrains'
java-version: 17
cache: 'gradle'
package-type: 'jdk+jcef'
# For GitHub API (use if you believe you'd run into rate limits)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: build
id: build
run: |
./gradlew arbigent-cli:assemble --stacktrace
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: cli-artifact
path: |
arbigent-cli/build/distributions/*
retention-days: 120
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
arbigent-cli/build/distributions/*
- name: Extract version
id: extract-version
run: |
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
- name: Update formula on tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: "mislav/bump-homebrew-formula-action@v2"
with:
download-url: https://github.com/takahirom/arbigent/releases/download/${{ steps.extract-version.outputs.tag-name }}/arbigent-${{ steps.extract-version.outputs.tag-name }}.tar.gz
formula-name: arbigent
homebrew-tap: takahirom/homebrew-repo
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
cli-e2e-android:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [ 1, 2, 3, 4 ]
shardTotal: [ 4 ]
steps:
- name: Delete unnecessary tools 🔧
uses: jlumbroso/free-disk-space@v1.3.1
with:
android: false # Don't remove Android tools
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY"
dotnet: true # rm -rf /usr/share/dotnet
haskell: true # rm -rf /opt/ghc...
swap-storage: true # rm -f /mnt/swapfile (4GiB)
docker-images: false # Takes 16s, enable if needed in the future
large-packages: false # includes google-cloud-sdk and it's slow
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls /dev/kvm
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup JBR 17
uses: gmitch215/setup-java@main
with:
distribution: 'jetbrains'
java-version: 17
cache: 'gradle'
package-type: 'jdk+jcef'
# For GitHub API (use if you believe you'd run into rate limits)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: build
id: build
run: |
./gradlew arbigent-cli:installDist --stacktrace
- name: CLI E2E test
uses: reactivecircus/android-emulator-runner@v2
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_FREE_API_KEY }}
with:
api-level: 34
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: |
arbigent-cli/build/install/arbigent/bin/arbigent --os=android --project-file=sample-test/src/main/resources/projects/e2e-test-android.yaml --ai-type=gemini --gemini-model-name=gemini-2.0-flash-exp --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: cli-report-android-${{ matrix.shardIndex }}-${{ matrix.shardTotal }}
path: |
arbigent-result/*
retention-days: 120
cli-e2e-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup JBR 17
uses: gmitch215/setup-java@main
with:
distribution: 'jetbrains'
java-version: 17
cache: 'gradle'
package-type: 'jdk+jcef'
# For GitHub API (use if you believe you'd run into rate limits)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: build
id: build
run: |
./gradlew arbigent-cli:installDist --stacktrace
- name: Install Xcode
run: |
# Select Xcode 15.4
sudo xcode-select -s /Applications/Xcode_15.4.app
# Check Xcode version
xcodebuild -version
- name: Install applesimutils
run: brew tap wix/brew && brew install applesimutils
- name: Start iOS Simulator (with debug)
run: |
# List available devices
xcrun simctl list devices
# Start iPhone 15 Pro simulator
xcrun simctl boot "iPhone 15 Pro"
# Check simulator status periodically
SIMULATOR_BOOTED="false"
for i in {1..60}; do # Check for 1 minute (adjust as needed)
echo "Simulator status (attempt $i):"
STATUS=$(xcrun simctl bootstatus "iPhone 15 Pro")
echo "$STATUS"
if echo "$STATUS" | grep -q "Device already booted, nothing to do."; then
SIMULATOR_BOOTED="true"
break
elif echo "$STATUS" | grep -q "Status=4294967295, isTerminal=YES"; then
# This case is Finished, so treat it as Booted.
SIMULATOR_BOOTED="true"
break
elif echo "$STATUS" | grep -q "Error:"; then
echo "Error: Simulator encountered an error during boot."
exit 1
fi
sleep 5
done
# Check if the simulator booted successfully
if [ "$SIMULATOR_BOOTED" = "false" ]; then
echo "Error: Simulator failed to boot within the timeout period."
exit 1
fi
echo "Simulator booted successfully."
- name: CLI E2E test for iOS
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_FREE_API_KEY }}
run: |
arbigent-cli/build/install/arbigent/bin/arbigent --os=ios --project-file=sample-test/src/main/resources/projects/e2e-test-ios.yaml --ai-type=gemini --gemini-model-name=gemini-2.0-flash-exp
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: cli-ios-report
path: |
arbigent-result/*
retention-days: 120