Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Tests Workflow #2

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
54 changes: 54 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Unit Tests
on:
pull_request:
paths:
- aiorem/**
- tests/**
- pyproject.toml
- requirements-dev.txt
- .github/workflows/unit_tests.yml
push:
branches:
- main

jobs:
pytest:
name: pytest
runs-on: ${{matrix.os}}
strategy:
matrix:
python-version: ['3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: False
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install -r requirements-dev.txt

- name: Test with pytest
run: |
coverage run -m pytest -v --junit-xml=.test_report.xml

- name: Test Summary
id: test_summary
uses: test-summary/[email protected]
if: always() # always run, even if tests fail
with:
paths: |
.test_report.xml

- name: Submit coverage
uses: codecov/codecov-action@v4
with:
env_vars: OS,PYTHON
name: ${{ matrix.os }}-${{ matrix.python-version }}
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Issues = "https://github.com/Hinrich Mahler/aiorem/issues"
Source = "https://github.com/Hinrich Mahler/aiorem"

[tool.hatch.version]
path = "src/aiorem/__about__.py"
path = "aiorem/__about__.py"

# BLACK:
[tool.black]
Expand Down