Skip to content

Commit e7acbb2

Browse files
authored
ci: enhance ci env (#1303)
1 parent e23dc47 commit e7acbb2

4 files changed

Lines changed: 81 additions & 88 deletions

File tree

‎.github/actions/setup-appium-server/action.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ runs:
2828
steps:
2929
- name: Start Appium server
3030
shell: bash
31+
env:
32+
LOG_FILE: ${{ inputs.log_file }}
3133
run: |
3234
nohup appium server \
3335
--port=${{ inputs.port }} \
@@ -36,10 +38,12 @@ runs:
3638
--log-timestamp \
3739
--keep-alive-timeout 1200 \
3840
${{ inputs.server_args }} \
39-
2>&1 > ${{ inputs.log_file }} &
41+
> "$LOG_FILE" 2>&1 &
4042
4143
- name: Wait for Appium server to start
4244
shell: bash
45+
env:
46+
LOG_FILE: ${{ inputs.log_file }}
4347
run: |
4448
TIMEOUT_SEC=${{ inputs.timeout }}
4549
INTERVAL_SEC=1
@@ -51,12 +55,13 @@ runs:
5155
5256
if nc -z ${{ inputs.host }} ${{ inputs.port }}; then
5357
echo "Appium server is running after $elapsed seconds"
54-
cat ${{ inputs.log_file }}
58+
cat "$LOG_FILE"
5559
exit 0
5660
fi
5761
5862
if [[ "$elapsed" -ge "$TIMEOUT_SEC" ]]; then
5963
echo "${elapsed} seconds timeout reached: Appium server is NOT running"
64+
cat "$LOG_FILE"
6065
exit 1
6166
fi
6267

‎.github/workflows/functional-test.yml‎

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ env:
1414
APPIUM_TEST_SERVER_PORT: '4723'
1515
APPIUM_TEST_SERVER_HOST: '127.0.0.1'
1616
PYTHONUNBUFFERED: 1
17+
UV_LOCKED: 'true'
1718

1819
jobs:
1920
ios_test:
21+
timeout-minutes: 60
2022
strategy:
2123
fail-fast: false
2224
matrix:
@@ -80,39 +82,37 @@ jobs:
8082
with:
8183
python-version: 3.14
8284

83-
- name: Cache uv modules
84-
uses: actions/cache@v6
85+
- name: Set up uv
86+
uses: astral-sh/setup-uv@v10.1.0
8587
with:
86-
path: |
87-
~/.cache/uv
88-
.venv
89-
key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
90-
restore-keys: |
91-
${{ runner.os }}-uv-shared-
92-
93-
- name: Install uv
94-
run: make install-uv
88+
enable-cache: true
89+
python-version: '3.14'
9590

9691
- name: Run Tests
9792
run: |
9893
uv run pytest -v ${{ matrix.test_targets.target}} \
9994
--doctest-modules \
10095
--junitxml=junit/test-results.xml \
101-
--cov=com \
96+
--cov=appium \
10297
--cov-report=xml \
10398
--cov-report=html
10499
env:
105100
LOCAL_PREBUILT_WDA: ${{ env.PREBUILT_WDA_PATH }}
106101

107-
- name: Save server output
102+
- name: Save test diagnostics
108103
if: ${{ always() }}
109104
uses: actions/upload-artifact@master
110105
with:
111-
name: appium-ios-${{matrix.test_targets.name}}.log
112-
path: appium.log
106+
name: appium-ios-${{matrix.test_targets.name}}-diagnostics
107+
path: |
108+
appium.log
109+
junit/
110+
coverage.xml
111+
htmlcov/
113112
114113
115114
android_test:
115+
timeout-minutes: 60
116116
strategy:
117117
fail-fast: false
118118
matrix:
@@ -189,24 +189,19 @@ jobs:
189189
with:
190190
python-version: 3.14
191191

192-
- name: Cache uv modules
193-
uses: actions/cache@v6
192+
- name: Set up uv
193+
uses: astral-sh/setup-uv@v10.1.0
194194
with:
195-
path: |
196-
~/.cache/uv
197-
.venv
198-
key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
199-
restore-keys: |
200-
${{ runner.os }}-uv-shared-
195+
enable-cache: true
196+
python-version: '3.14'
201197

202198
- name: Run tests
203199
uses: reactivecircus/android-emulator-runner@v2
204200
with:
205201
api-level: ${{ env.API_LEVEL }}
206202
arch: ${{ env.ARCH }}
207203
script: |
208-
make install-uv
209-
uv run pytest -v ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
204+
uv run pytest -v ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=appium --cov-report=xml --cov-report=html
210205
target: google_apis
211206
profile: Nexus 5X
212207
disable-spellchecker: true
@@ -218,14 +213,19 @@ jobs:
218213
IGNORE_VERSION_SKIP: true
219214
CI: true
220215

221-
- name: Save server output
216+
- name: Save test diagnostics
222217
if: ${{ always() }}
223218
uses: actions/upload-artifact@master
224219
with:
225-
name: appium-android-${{matrix.test_targets.name}}.log
226-
path: appium.log
220+
name: appium-android-${{matrix.test_targets.name}}-diagnostics
221+
path: |
222+
appium.log
223+
junit/
224+
coverage.xml
225+
htmlcov/
227226
228227
flutter_e2e_test:
228+
timeout-minutes: 60
229229
# These flutter integration driver tests are maintained by: MummanaSubramanya
230230
strategy:
231231
fail-fast: false
@@ -305,24 +305,19 @@ jobs:
305305
server_args: '--relaxed-security'
306306
log_file: appium-${{ matrix.e2e-tests }}.log
307307

308-
- name: Cache uv modules
309-
uses: actions/cache@v6
308+
- name: Set up uv
309+
uses: astral-sh/setup-uv@v10.1.0
310310
with:
311-
path: |
312-
~/.cache/uv
313-
.venv
314-
key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
315-
restore-keys: |
316-
${{ runner.os }}-uv-shared-
311+
enable-cache: true
312+
python-version: '3.14'
317313

318314
- name: Run Android tests
319315
if: matrix.e2e-tests == 'flutter-android'
320316
uses: reactivecircus/android-emulator-runner@v2
321317
with:
322318
api-level: ${{ env.API_LEVEL }}
323319
script: |
324-
make install-uv
325-
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
320+
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
326321
target: default
327322
disable-spellchecker: true
328323
disable-animations: true
@@ -349,20 +344,23 @@ jobs:
349344
- name: Run IOS tests
350345
if: matrix.e2e-tests == 'flutter-ios'
351346
run: |
352-
make install-uv
353347
export PLATFORM=ios
354348
uv run pytest -v test/functional/flutter_integration/*_test.py \
355349
--doctest-modules \
356350
--junitxml=junit/test-results.xml \
357-
--cov=com \
351+
--cov=appium \
358352
--cov-report=xml \
359353
--cov-report=html
360354
env:
361355
LOCAL_PREBUILT_WDA: ${{ env.PREBUILT_WDA_PATH }}
362356

363-
- name: Save server output
357+
- name: Save test diagnostics
364358
if: ${{ always() }}
365359
uses: actions/upload-artifact@master
366360
with:
367-
name: appium-${{ matrix.e2e-tests }}.log
368-
path: appium-${{ matrix.e2e-tests }}.log
361+
name: appium-${{ matrix.e2e-tests }}-diagnostics
362+
path: |
363+
appium-${{ matrix.e2e-tests }}.log
364+
junit/
365+
coverage.xml
366+
htmlcov/

‎.github/workflows/lock-update.yml‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎.github/workflows/unit-test.yml‎

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,36 @@ on:
77
pull_request:
88
branches: [ master ]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
UV_LOCKED: 'true'
16+
1017
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
steps:
22+
- uses: actions/checkout@v7
23+
- name: Set up Python
24+
uses: actions/setup-python@v7
25+
with:
26+
python-version: '3.14'
27+
- name: Set up uv
28+
uses: astral-sh/setup-uv@v10.1.0
29+
with:
30+
enable-cache: true
31+
python-version: '3.14'
32+
- name: Check lint and formatting
33+
run: |
34+
uv run ruff check .
35+
make check-format
36+
1137
test-ubuntu:
1238
runs-on: ubuntu-latest
39+
timeout-minutes: 20
1340
strategy:
1441
matrix:
1542
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
@@ -19,18 +46,12 @@ jobs:
1946
uses: actions/setup-python@v7
2047
with:
2148
python-version: ${{ matrix.python-version }}
22-
- name: Cache uv modules
23-
uses: actions/cache@v6
49+
- name: Set up uv
50+
uses: astral-sh/setup-uv@v10.1.0
2451
with:
25-
path: |
26-
~/.cache/uv
27-
.venv
28-
key: ${{ runner.os }}-uv-shared-${{ hashFiles('**/uv.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-uv-shared-
31-
- name: Install uv
32-
run: make install-uv
33-
- name: Run Checks
34-
run: make check
52+
enable-cache: true
53+
python-version: ${{ matrix.python-version }}
54+
- name: Check types
55+
run: uv run mypy appium
3556
- name: Run Unit Tests
3657
run: make unittest

0 commit comments

Comments
 (0)