-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 Add GitHub Actions workflow for running pytest
- Set up GitHub Actions to automatically run `pytest` on pushes and pull requests for the `main` and `chore/pypi-release` branches. - Configured a testing matrix to run tests on Python versions 3.7 through 3.11. - Integrated dependency installation using `requirements.txt` or `pyproject.toml` (if present). - Added steps to checkout code, set up Python environments, and run pytest with coverage.
- Loading branch information
1 parent
d17196c
commit d31360b
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Run Tests | ||
|
||
on: ['push', 'pull_request'] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] # Define OS you want to test | ||
python-version: [3.7, 3.11] # Define Python versions you want to test | ||
|
||
name: P${{ matrix.python-version }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
if [ -f pyproject.toml ]; then pip install .[dev]; fi | ||
- name: Run tests | ||
run: | | ||
pytest --cov # Run pytest with coverage if needed |
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