update to python 3.12 #204
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# file tests.yml | |
# | |
# SPDX-FileCopyrightText: (c) 2022 Michal Kielan | |
# | |
# SPDX-License-Identifier: GPL-3.0-only | |
# | |
name: tests | |
on: [push, pull_request] | |
env: | |
ENVIRONMENT: GITHUB_WORKFLOWS | |
ADB_INSTALL_TIMEOUT: 8 | |
TEST_DEVICE_ID: emulator-5554 | |
ROOTABLE_DEVICE: 1 | |
jobs: | |
tests: | |
runs-on: macos-12 | |
strategy: | |
matrix: | |
api-level: [27] | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest coverage wget interruptingcow | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.api-level }} | |
- name: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82' | |
coverage run --source=simpleadb -m pytest -v tests | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v2 |