Skip to content

Commit

Permalink
ci | add github action for pytest
Browse files Browse the repository at this point in the history
* help by claude
* add test dependencies
  • Loading branch information
flokno committed Sep 30, 2024
1 parent 87587ba commit 524e7cb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: pytest

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8']
# python-version: ['3.8', '3.9', '3.10', '3.11']

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 -m pip install --upgrade pip
pip install .[test]
- name: Test with pytest
run: |
pip install pytest
pytest tests/ --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=. --cov-report=xml --cov-report=html
- name: Upload pytest results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tools.tdep
===

![python](https://img.shields.io/badge/python-3.7--3.11-lightgrey.svg?style=flat-square)
![python](https://img.shields.io/badge/python-3.8--3.11-lightgrey.svg?style=flat-square)
[![license](https://img.shields.io/github/license/flokno/tools.tdep?color=red&style=flat-square)](https://opensource.org/licenses/ISC)
[![code style](https://img.shields.io/badge/code%20style-black-202020.svg?style=flat-square)](https://github.com/ambv/black)
![build status](https://app.travis-ci.com/flokno/tools.tdep.svg?branch=main)
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ install_requires =
toml >= 0.10.1
spglib >= 1.0

[options.extras_require]
tests =
pytest
pytest-cov

[options.packages.find]
include =
tdeptools
Expand Down

0 comments on commit 524e7cb

Please sign in to comment.