Skip to content

Commit

Permalink
fix: update tests action to avoid hardcoding package name
Browse files Browse the repository at this point in the history
  • Loading branch information
akatief committed Feb 21, 2024
1 parent 0efbff3 commit 2b44370
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ jobs:
run: |
pip install .
pip install -r requirements-dev.txt
# Hacky way to get package name from setup.py
- name: Get package name
id: get_package_name
run: |
echo "::set-output name=package_name::$(python -c "import re; \
with open('setup.py', 'r') as f: \
data = f.read(); \
print(re.search(r"name\s*=\s*['\"]([^'\"]+)['\"]", data).group(1))")"
- name: Run tests
run: |
pytest -v --cov-fail-under=60 --cov=ukp_project_template -l --tb=short --maxfail=1 tests/
pytest -v --cov-fail-under=60 --cov=${{ steps.get_package_name.outputs.package_name }} -l --tb=short --maxfail=1 tests/
coverage xml
coverage html

0 comments on commit 2b44370

Please sign in to comment.