|
| 1 | +# DeviceLab Appium Action |
| 2 | + |
| 3 | +A GitHub Action that starts a DeviceLab test node service for Appium mobile testing in your CI/CD pipeline. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🚀 **Easy Setup**: One-step DeviceLab test node configuration |
| 8 | +- 📱 **APK Support**: Automatically handles APK artifacts from build jobs |
| 9 | +- 🔧 **Configurable**: Customizable ports, timeouts, and URLs |
| 10 | +- 🛡️ **Robust**: Comprehensive error handling and debugging |
| 11 | +- ✅ **Ready Detection**: Waits for test node to be fully operational |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +### Basic Example |
| 16 | + |
| 17 | +```yaml |
| 18 | +name: Mobile Testing |
| 19 | +on: [push, pull_request] |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + # Your build steps here... |
| 28 | + |
| 29 | + - name: Upload APK |
| 30 | + uses: actions/upload-artifact@v4 |
| 31 | + with: |
| 32 | + name: app-release |
| 33 | + path: path/to/your/app.apk |
| 34 | + |
| 35 | + test: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + needs: build |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Start DeviceLab Appium |
| 42 | + uses: izinga/devicelab_appium@v1 |
| 43 | + with: |
| 44 | + devicelab-url: 'https://app.devicelab.dev/node/your-node-id' |
| 45 | + apk-artifact-name: 'app-release' |
| 46 | + |
| 47 | + - name: Run Appium Tests |
| 48 | + run: | |
| 49 | + # Your tests connect to http://localhost:4723 |
| 50 | + python -m pytest tests/ |
| 51 | +``` |
| 52 | +
|
| 53 | +### Advanced Example |
| 54 | +
|
| 55 | +```yaml |
| 56 | +- name: Start DeviceLab Appium |
| 57 | + id: testnode |
| 58 | + uses: izinga/devicelab_appium@v1 |
| 59 | + with: |
| 60 | + devicelab-url: 'https://custom.devicelab.url/script' |
| 61 | + apk-artifact-name: 'my-app-build' |
| 62 | + test-node-port: '8080' |
| 63 | + wait-timeout: '600' |
| 64 | + |
| 65 | +- name: Run Tests |
| 66 | + run: | |
| 67 | + echo "Test node running at: ${{ steps.testnode.outputs.test-node-url }}" |
| 68 | + pytest tests/ --appium-url="${{ steps.testnode.outputs.test-node-url }}" |
| 69 | +
|
| 70 | +- name: Cleanup |
| 71 | + if: always() |
| 72 | + run: | |
| 73 | + docker stop ${{ steps.testnode.outputs.container-name }} || true |
| 74 | +``` |
| 75 | +
|
| 76 | +## Inputs |
| 77 | +
|
| 78 | +| Input | Required | Default | Description | |
| 79 | +|-------|----------|---------|-------------| |
| 80 | +| `devicelab-url` | ✅ | - | DeviceLab script URL | |
| 81 | +| `apk-artifact-name` | ✅ | - | Name of the artifact containing the APK | |
| 82 | +| `apk-path` | ❌ | `app-release.apk` | Path to APK within artifact | |
| 83 | +| `test-node-port` | ❌ | `4723` | Port for the test node server | |
| 84 | +| `wait-timeout` | ❌ | `300` | Timeout in seconds | |
| 85 | +| `registry` | ❌ | `ghcr.io` | Container registry | |
| 86 | + |
| 87 | +## Outputs |
| 88 | + |
| 89 | +| Output | Description | |
| 90 | +|--------|-------------| |
| 91 | +| `test-node-url` | URL of the running test node | |
| 92 | +| `container-name` | Docker container name | |
| 93 | + |
| 94 | +## Error Handling |
| 95 | + |
| 96 | +This action provides detailed error messages for common issues: |
| 97 | + |
| 98 | +- **Invalid DeviceLab URL**: Tests URL accessibility |
| 99 | +- **Missing APK artifact**: Clear guidance on artifact setup |
| 100 | +- **Test node startup failures**: Container logs and debugging info |
| 101 | +- **Timeout issues**: Suggestions for resolution |
| 102 | + |
| 103 | +## Requirements |
| 104 | + |
| 105 | +- Linux runner (Ubuntu recommended) |
| 106 | +- Docker available in the runner |
| 107 | +- APK artifact from a previous job |
| 108 | + |
| 109 | +## License |
| 110 | + |
| 111 | +MIT License - see [LICENSE](LICENSE) file. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +**Created by:** Om Narayan |
| 116 | +**Organization:** Izinga Software Private Limited |
0 commit comments