Skip to content

Commit

Permalink
Update CI (#11)
Browse files Browse the repository at this point in the history
* Add pytest config

* Update test workflow

* Fix workflow file

* Update test actions (#10)

* Cache pip dependencies

* Add test badge

* Run pytest-cov

* Tests needs init

* Add codecov badge
  • Loading branch information
yaugenst authored Nov 18, 2023
1 parent d05d009 commit bb73fe5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/tests.yml → .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,38 @@ name: Tests

on:
push:
branches: [ "main" ]
branches: [develop]
pull_request:
branches: [ "main" ]
branches: [main, develop]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
max-parallel: 6
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]

python-version: ['3.10', '3.11']
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Test with pytest
run: |
pytest --cov=tofea
run: pytest --cov tofea

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# TOFEA

[![Tests](https://github.com/yaugenst/tofea/actions/workflows/run_tests.yml/badge.svg)](https://github.com/yaugenst/tofea/actions/workflows/run_tests.yml)
[![codecov](https://codecov.io/gh/yaugenst/tofea/graph/badge.svg?token=5Z2SYQ3CPM)](https://codecov.io/gh/yaugenst/tofea)

Simple [autograd](https://github.com/HIPS/autograd)-differentiable finite element analysis for heat conductivity and compliance problems.

## Installation
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ target-version = "py310"
mypy_strict = true
python_version = "3.10"
ignore_missing_imports = true

[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning"]
Empty file added tests/__init__.py
Empty file.

0 comments on commit bb73fe5

Please sign in to comment.