Files
Browser/.github/workflows/test.yml

74 lines
2.0 KiB
YAML

# TODO: Update to use specific commit hashes for the actions for better supply chain security.
name: Run Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
strategy:
matrix:
python-version: ['3.13']
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Configure Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache Poetry dependencies
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-${{ matrix.python-version }}-
- name: Install dependencies
run: poetry install
- name: Run linting with ruff
run: |
poetry run ruff check ./ren_browser/
poetry run ruff check ./tests/
- name: Run tests with pytest
run: |
poetry run pytest -v --cov=ren_browser --cov-report=xml --cov-report=term
- name: Upload coverage reports
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457
if: matrix.python-version == '3.13'
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false