Merge pull request #2790 from PMEAL/enh_release_logger #905
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
name: Tests | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
max-parallel: 9 | |
matrix: | |
python-version: ['3.8', '3.9', '3.10'] | |
# Add macos-latest to the next line once #2451 is fixed | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
steps: | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies (pip) | |
run: | | |
pip install \ | |
-r requirements.txt \ | |
-r requirements/tests.txt | |
- name: Disable numba JIT for codecov to include jitted methods | |
if: (matrix.python-version == 3.8) && (matrix.os == 'ubuntu-latest') | |
run: | | |
echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV | |
- name: Running tests | |
run: | |
pytest . | |
--cov=. | |
--cov-report=xml | |
--color=yes | |
- name: Upload coverage to Codecov | |
if: (matrix.python-version == 3.9) && (matrix.os == 'ubuntu-latest') | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
- name: flake8 Lint | |
if: (matrix.python-version == 3.9) && (matrix.os == 'ubuntu-latest') | |
uses: py-actions/flake8@v2 | |
with: | |
ignore: "D100,E226,E402,E712,E741,F401,F403,N806,W503,WPS111,WPS211,WPS237,WPS300,WPS305,WPS319,WPS347,WPS410,WPS437" | |
exclude: "docs/,scripts/,tests/,openpnm/contrib/,setup.py,openpnm/models/_doctxt.py,openpnm/models/phase/_phasedocs.py,openpnm/models/geometry/_geodocs.py" | |
max-line-length: "90" | |
path: ".." |