fix: include exception message for codacy fix #206
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
name: Tests | |
on: | |
push: {} | |
workflow_dispatch: {} | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build_package_and_run_tests: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install Package Dependencies | |
run: pip install .[caching,dataframe,jsonld,tests] | |
- name: Install coverage | |
run: pip install coverage | |
if: matrix.python-version == 3.12 | |
- name: Run Tests with coverage | |
# only need to run coverage once on selected Python version | |
run: coverage run --source . -m pytest tests/ | |
if: matrix.python-version == 3.12 | |
- name: Coverage report | |
run: | | |
coverage report -m | |
# generate coverage.xml output | |
coverage xml | |
# upload coverage to codacy | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
if: matrix.python-version == 3.12 | |
- name: Run Tests | |
run: python -m pytest tests | |
if: matrix.python-version != 3.12 | |
build_package_and_run_tests_py37: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7"] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install Package Dependencies | |
# caching feature requires Python 3.8+, skipping it for Python 3.7 | |
run: pip install .[dataframe,jsonld,tests] | |
- name: Run Tests | |
run: python -m pytest tests |