Skip to content

Refactoring to facilitate interactive use of ReX #19

Refactoring to facilitate interactive use of ReX

Refactoring to facilitate interactive use of ReX #19

# This workflow will install ReX and run tests, using the highest and lowest Python versions we support
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build and run tests
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python, install and cache dependencies
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
cache: poetry
- run: poetry install --with dev
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
- name: Cache model files for testing
uses: actions/cache@v3
env:
cache-name: cache-model-files
with:
path: ~/.cache/cached_path
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('tests/conftest.py') }}
- name: Test with pytest
run: |
pytest --junitxml=pytest.xml --cov-report=xml:coverage.xml --cov=rex_xai tests/
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@v1.1.52
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
pytest-xml-coverage-path: ./coverage.xml