diff --git a/.github/actions/setup-appium-server/action.yml b/.github/actions/setup-appium-server/action.yml index a9177d4e8..d866ce451 100644 --- a/.github/actions/setup-appium-server/action.yml +++ b/.github/actions/setup-appium-server/action.yml @@ -28,6 +28,8 @@ runs: steps: - name: Start Appium server shell: bash + env: + LOG_FILE: ${{ inputs.log_file }} run: | nohup appium server \ --port=${{ inputs.port }} \ @@ -36,10 +38,12 @@ runs: --log-timestamp \ --keep-alive-timeout 1200 \ ${{ inputs.server_args }} \ - 2>&1 > ${{ inputs.log_file }} & + > "$LOG_FILE" 2>&1 & - name: Wait for Appium server to start shell: bash + env: + LOG_FILE: ${{ inputs.log_file }} run: | TIMEOUT_SEC=${{ inputs.timeout }} INTERVAL_SEC=1 @@ -51,12 +55,13 @@ runs: if nc -z ${{ inputs.host }} ${{ inputs.port }}; then echo "Appium server is running after $elapsed seconds" - cat ${{ inputs.log_file }} + cat "$LOG_FILE" exit 0 fi if [[ "$elapsed" -ge "$TIMEOUT_SEC" ]]; then echo "${elapsed} seconds timeout reached: Appium server is NOT running" + cat "$LOG_FILE" exit 1 fi diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index f48489860..b297dfe77 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -14,9 +14,11 @@ env: APPIUM_TEST_SERVER_PORT: '4723' APPIUM_TEST_SERVER_HOST: '127.0.0.1' PYTHONUNBUFFERED: 1 + UV_LOCKED: 'true' jobs: ios_test: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -80,39 +82,37 @@ jobs: with: python-version: 3.14 - - name: Cache uv modules - uses: actions/cache@v6 + - name: Set up uv + uses: astral-sh/setup-uv@v10.1.0 with: - path: | - ~/.cache/uv - .venv - key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }} - restore-keys: | - ${{ runner.os }}-uv-shared- - - - name: Install uv - run: make install-uv + enable-cache: true + python-version: '3.14' - name: Run Tests run: | uv run pytest -v ${{ matrix.test_targets.target}} \ --doctest-modules \ --junitxml=junit/test-results.xml \ - --cov=com \ + --cov=appium \ --cov-report=xml \ --cov-report=html env: LOCAL_PREBUILT_WDA: ${{ env.PREBUILT_WDA_PATH }} - - name: Save server output + - name: Save test diagnostics if: ${{ always() }} uses: actions/upload-artifact@master with: - name: appium-ios-${{matrix.test_targets.name}}.log - path: appium.log + name: appium-ios-${{matrix.test_targets.name}}-diagnostics + path: | + appium.log + junit/ + coverage.xml + htmlcov/ android_test: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -189,15 +189,11 @@ jobs: with: python-version: 3.14 - - name: Cache uv modules - uses: actions/cache@v6 + - name: Set up uv + uses: astral-sh/setup-uv@v10.1.0 with: - path: | - ~/.cache/uv - .venv - key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }} - restore-keys: | - ${{ runner.os }}-uv-shared- + enable-cache: true + python-version: '3.14' - name: Run tests uses: reactivecircus/android-emulator-runner@v2 @@ -205,8 +201,7 @@ jobs: api-level: ${{ env.API_LEVEL }} arch: ${{ env.ARCH }} script: | - make install-uv - uv run pytest -v ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html + uv run pytest -v ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=appium --cov-report=xml --cov-report=html target: google_apis profile: Nexus 5X disable-spellchecker: true @@ -218,14 +213,19 @@ jobs: IGNORE_VERSION_SKIP: true CI: true - - name: Save server output + - name: Save test diagnostics if: ${{ always() }} uses: actions/upload-artifact@master with: - name: appium-android-${{matrix.test_targets.name}}.log - path: appium.log + name: appium-android-${{matrix.test_targets.name}}-diagnostics + path: | + appium.log + junit/ + coverage.xml + htmlcov/ flutter_e2e_test: + timeout-minutes: 60 # These flutter integration driver tests are maintained by: MummanaSubramanya strategy: fail-fast: false @@ -305,15 +305,11 @@ jobs: server_args: '--relaxed-security' log_file: appium-${{ matrix.e2e-tests }}.log - - name: Cache uv modules - uses: actions/cache@v6 + - name: Set up uv + uses: astral-sh/setup-uv@v10.1.0 with: - path: | - ~/.cache/uv - .venv - key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }} - restore-keys: | - ${{ runner.os }}-uv-shared- + enable-cache: true + python-version: '3.14' - name: Run Android tests if: matrix.e2e-tests == 'flutter-android' @@ -321,8 +317,7 @@ jobs: with: api-level: ${{ env.API_LEVEL }} script: | - make install-uv - uv run pytest -v test/functional/flutter_integration/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html + uv run pytest -v test/functional/flutter_integration/*_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=appium --cov-report=xml --cov-report=html target: default disable-spellchecker: true disable-animations: true @@ -349,20 +344,23 @@ jobs: - name: Run IOS tests if: matrix.e2e-tests == 'flutter-ios' run: | - make install-uv export PLATFORM=ios uv run pytest -v test/functional/flutter_integration/*_test.py \ --doctest-modules \ --junitxml=junit/test-results.xml \ - --cov=com \ + --cov=appium \ --cov-report=xml \ --cov-report=html env: LOCAL_PREBUILT_WDA: ${{ env.PREBUILT_WDA_PATH }} - - name: Save server output + - name: Save test diagnostics if: ${{ always() }} uses: actions/upload-artifact@master with: - name: appium-${{ matrix.e2e-tests }}.log - path: appium-${{ matrix.e2e-tests }}.log + name: appium-${{ matrix.e2e-tests }}-diagnostics + path: | + appium-${{ matrix.e2e-tests }}.log + junit/ + coverage.xml + htmlcov/ diff --git a/.github/workflows/lock-update.yml b/.github/workflows/lock-update.yml deleted file mode 100644 index 8af24642e..000000000 --- a/.github/workflows/lock-update.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Update uv.lock - -on: - pull_request: - types: [ opened, synchronize ] - paths: - - 'pyproject.toml' - -permissions: - contents: write - pull-requests: write - -jobs: - uv-lock-update: - if: github.actor == 'dependabot[bot]' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.head_ref }} - - name: Set up Python - uses: actions/setup-python@v7 - with: - python-version: '3.12' - - name: Install uv - run: make install-uv - - run: uv lock - - uses: stefanzweifel/git-auto-commit-action@v7 - with: - commit_message: "chore: Refresh uv.lock" diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 37cfa1624..3fb51951f 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -7,9 +7,36 @@ on: pull_request: branches: [ master ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + UV_LOCKED: 'true' + jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v7 + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: '3.14' + - name: Set up uv + uses: astral-sh/setup-uv@v10.1.0 + with: + enable-cache: true + python-version: '3.14' + - name: Check lint and formatting + run: | + uv run ruff check . + make check-format + test-ubuntu: runs-on: ubuntu-latest + timeout-minutes: 20 strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] @@ -19,18 +46,12 @@ jobs: uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - - name: Cache uv modules - uses: actions/cache@v6 + - name: Set up uv + uses: astral-sh/setup-uv@v10.1.0 with: - path: | - ~/.cache/uv - .venv - key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }} - restore-keys: | - ${{ runner.os }}-uv-shared- - - name: Install uv - run: make install-uv - - name: Run Checks - run: make check + enable-cache: true + python-version: ${{ matrix.python-version }} + - name: Check types + run: uv run mypy appium - name: Run Unit Tests run: make unittest