From bb73fe5ea3642348065f8698e8f55f48b5c76566 Mon Sep 17 00:00:00 2001 From: Yannick Augenstein <1576526+yaugenst@users.noreply.github.com> Date: Fri, 17 Nov 2023 17:32:10 -0800 Subject: [PATCH] Update CI (#11) * 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 --- .../workflows/{tests.yml => run_tests.yml} | 26 ++++++++++++------- README.md | 3 +++ pyproject.toml | 3 +++ tests/__init__.py | 0 4 files changed, 22 insertions(+), 10 deletions(-) rename .github/workflows/{tests.yml => run_tests.yml} (54%) create mode 100644 tests/__init__.py diff --git a/.github/workflows/tests.yml b/.github/workflows/run_tests.yml similarity index 54% rename from .github/workflows/tests.yml rename to .github/workflows/run_tests.yml index 80d1c70..d278f25 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/run_tests.yml @@ -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 }} diff --git a/README.md b/README.md index 8582a0a..d2af458 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index cccec7f..15e9597 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29