diff --git a/.github/actions/setup-python-cached/action.yml b/.github/actions/setup-python-cached/action.yml deleted file mode 100644 index cebaf6b..0000000 --- a/.github/actions/setup-python-cached/action.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: 'Setup Python with Cached Dependencies' -description: 'Setup Python and cache entire site-packages directory' - -inputs: - python-version: - description: 'Python version to use' - required: false - default: '3.11' - -runs: - using: 'composite' - steps: - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.python-version }} - - - name: Get Python paths - id: python-paths - shell: bash - run: | - # Get Python paths using Python - python << 'EOF' - import os - import sys - import site - import subprocess - - # Get site-packages path - site_packages = site.getsitepackages()[0] - - # Get pip cache dir - pip_cache = subprocess.check_output([sys.executable, "-m", "pip", "cache", "dir"]).decode().strip() - - # Output for GitHub Actions - output_file = os.environ.get('GITHUB_OUTPUT', '') - if output_file: - with open(output_file, 'a') as f: - f.write(f"site-packages={site_packages}\n") - f.write(f"pip-cache={pip_cache}\n") - f.write(f"python-version={sys.version}\n") - EOF - - - name: Cache Python environment - uses: actions/cache@v3 - id: python-cache - with: - path: | - ${{ steps.python-paths.outputs.site-packages }} - ${{ steps.python-paths.outputs.pip-cache }} - ~/.local/bin - ~/.local/lib - ~/Library/Python - /opt/hostedtoolcache/Python/*/x64/bin - /opt/hostedtoolcache/Python/*/x64/lib/python*/site-packages - key: ${{ runner.os }}-py${{ inputs.python-version }}-${{ hashFiles('requirements.txt', 'pyproject.toml') }}-v2 - restore-keys: | - ${{ runner.os }}-py${{ inputs.python-version }}- - - - name: Install dependencies - shell: bash - run: | - echo "Cache hit: ${{ steps.python-cache.outputs.cache-hit }}" - echo "Python version: ${{ steps.python-paths.outputs.python-version }}" - echo "Site packages: ${{ steps.python-paths.outputs.site-packages }}" - - # Always ensure pip is up to date - pip install --upgrade pip - - if [[ "${{ steps.python-cache.outputs.cache-hit }}" != "true" ]]; then - echo "Cache miss - installing all dependencies" - pip install -r requirements.txt - pip install -e . - else - echo "Cache hit - verifying and reinstalling if needed" - # Check if black is available - if ! command -v black &> /dev/null; then - echo "Tools not in PATH, reinstalling..." - pip install -r requirements.txt - fi - # Always reinstall the local package in case code changed - pip install -e . --no-deps --force-reinstall - fi - - # Ensure tools are in PATH - export PATH="$HOME/.local/bin:$PATH" - echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV - - - name: Verify installation - shell: bash - run: | - echo "=== Installed packages ===" - pip list 2>/dev/null | head -20 || true - echo "..." - echo "=== Package location ===" - python -c "import ovmobilebench; print(f'Package installed at: {ovmobilebench.__file__}')" || echo "Package not found" - echo "=== CLI availability ===" - which ovmobilebench || echo "CLI not in PATH" \ No newline at end of file diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..e6e5eab --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,19 @@ +ignore: + - "tests/**" + - "experiments/**" + - "**/__pycache__" + - "**/*.pyc" + - "setup.py" + - "scripts/generate_ssh_config.py" + - "scripts/test_ssh_device_ci.py" + +coverage: + status: + project: + default: + target: auto + threshold: 1% + patch: + default: + target: 80% + threshold: 5% diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..64b9c0b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + day: "friday" + open-pull-requests-limit: 10 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "friday" + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci-orchestrator.yml b/.github/workflows/ci-orchestrator.yml index 6c29a44..e4cda61 100644 --- a/.github/workflows/ci-orchestrator.yml +++ b/.github/workflows/ci-orchestrator.yml @@ -42,4 +42,4 @@ jobs: with: os: ${{ inputs.os }} device_serial: ${{ inputs.device_serial }} - secrets: inherit \ No newline at end of file + secrets: inherit diff --git a/.github/workflows/stage-build.yml b/.github/workflows/stage-build.yml index 5a73373..ef65fbb 100644 --- a/.github/workflows/stage-build.yml +++ b/.github/workflows/stage-build.yml @@ -13,8 +13,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python with cached dependencies - uses: ./.github/actions/setup-python-cached + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install -e . - name: Build package run: python -m build @@ -24,4 +32,4 @@ jobs: with: name: dist-${{ inputs.os }} path: dist/ - retention-days: 7 \ No newline at end of file + retention-days: 7 diff --git a/.github/workflows/stage-device-tests.yml b/.github/workflows/stage-device-tests.yml index 48cc4b0..d4948e5 100644 --- a/.github/workflows/stage-device-tests.yml +++ b/.github/workflows/stage-device-tests.yml @@ -18,8 +18,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python with cached dependencies - uses: ./.github/actions/setup-python-cached + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install -e . - name: Set up SSH server run: | @@ -57,8 +65,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python with cached dependencies - uses: ./.github/actions/setup-python-cached + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install -e . - name: Check ADB devices run: adb devices @@ -77,4 +93,4 @@ jobs: with: name: benchmark-results-adb-${{ inputs.os }} path: experiments/results/ - retention-days: 30 \ No newline at end of file + retention-days: 30 diff --git a/.github/workflows/stage-lint-test.yml b/.github/workflows/stage-lint-test.yml index 0087ea4..3ad985c 100644 --- a/.github/workflows/stage-lint-test.yml +++ b/.github/workflows/stage-lint-test.yml @@ -12,9 +12,19 @@ jobs: runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all branches + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' - - name: Setup Python with cached dependencies - uses: ./.github/actions/setup-python-cached + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install -e . - name: Run Black run: black --check ovmobilebench tests @@ -28,14 +38,9 @@ jobs: - name: Run tests run: pytest tests/ -v --cov=ovmobilebench --cov=scripts --cov-report=xml --cov-report=term-missing - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5.4.3 with: - files: ./coverage.xml - flags: unittests - name: codecov-${{ inputs.os }} - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + files: coverage.xml + diff --git a/.github/workflows/stage-validation.yml b/.github/workflows/stage-validation.yml index e3a94df..2425c35 100644 --- a/.github/workflows/stage-validation.yml +++ b/.github/workflows/stage-validation.yml @@ -13,8 +13,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python with cached dependencies - uses: ./.github/actions/setup-python-cached + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + pip install -e . - name: Validate example config run: | @@ -32,4 +40,4 @@ jobs: ovmobilebench all --help ovmobilebench package --help ovmobilebench deploy --help - ovmobilebench report --help \ No newline at end of file + ovmobilebench report --help diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 620010b..0000000 --- a/codecov.yml +++ /dev/null @@ -1,41 +0,0 @@ -codecov: - require_ci_to_pass: yes - token: required - -coverage: - precision: 2 - round: down - range: "70...100" - - status: - project: - default: - target: auto - threshold: 1% - paths: - - "ovmobilebench/" - - "scripts/" - patch: - default: - target: auto - threshold: 1% - -parsers: - gcov: - branch_detection: - conditional: yes - loop: yes - method: no - macro: no - -comment: - layout: "reach,diff,flags,files,footer" - behavior: default - require_changes: no - -ignore: - - "tests/" - - "experiments/" - - "**/__pycache__" - - "**/*.pyc" - - "setup.py"