Skip to content

Add xpath restore utils #24

Add xpath restore utils

Add xpath restore utils #24

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
- dev
jobs:
unit-tests:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
poetry-version: ["latest"]
os: ["ubuntu-24.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
# Upload cache takes longer than the build itself, so we don't need it for now
# - uses: actions/cache@v3
# name: Define a cache for the virtual environment based on the dependencies lock file
# with:
# path: ./.venv
# key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
# restore-keys: |
# venv-${{ runner.os }}-py${{ matrix.python-version }}-
# venv-${{ runner.os }}-
- name: Install the project dependencies
run: poetry install
- name: Check code style with black
run: poetry run black --check .
- name: Check imports with isort
run: poetry run isort --check-only --diff .
# - name: Run static type checking
# run: poetry run mypy emmetify
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 emmetify --count --show-source --statistics
# exit-zero treats all errors as warnings
# poetry run flake8 emmetify --count --exit-zero --max-complexity=10 --statistics
- name: Test with pytest
run: |
poetry run pytest -v --cov=emmetify --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3.12' # Only upload coverage once
with:
token: ${{ secrets.CODECOV_TOKEN }}
package-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: latest
- name: Build package
run: poetry build
- name: Verify package metadata
run: |
pip install twine
twine check dist/*
- name: Test package installation
run: |
pip install dist/*.whl
python -c "import emmetify; print(emmetify.__version__)"