name: Ubuntu

on: [push]

jobs:
  build:

    runs-on: ${{ matrix.operating-system }}
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.6, 3.7]
        operating-system: [ubuntu-latest]

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/pip_requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-

    - name: Install Dependencies
      # if: steps.cache.outputs.cache-hit != 'true'
      run: |
        pip install -r requirements/pip_requirements.txt
        pip install -r requirements/test_requirements.txt
        pip uninstall openpnm --yes
        python setup.py install

    - name: Running tests
      run: pytest --pep8 --cov=./ --cov-report=xml --ignore=scripts/

    - name: Upload coverage to Codecov
      if: matrix.python-version == 3.7
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        file: ./coverage.xml
        flags: unittests
        name: codecov-umbrella
        yml: ./codecov.yml

name: Ubuntu

on: [push]

jobs:
  build:

    runs-on: ${{ matrix.operating-system }}
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.6, 3.7]
        operating-system: [ubuntu-latest]

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/pip_requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-

    - name: Install Dependencies
      # if: steps.cache.outputs.cache-hit != 'true'
      run: |
        pip install -r requirements/pip_requirements.txt
        pip install -r requirements/test_requirements.txt
        pip uninstall openpnm --yes
        python setup.py install
        pip install mpi4py petsc petsc4py

    - name: Running tests
      run: pytest --pep8 --cov=./ --cov-report=xml --ignore=scripts/

    - name: Upload coverage to Codecov
      if: matrix.python-version == 3.7
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        file: ./coverage.xml
        flags: unittests
        name: codecov-umbrella
        yml: ./codecov.yml

Add petsc install to CI-Ubuntu to test our PETSc wrapper
Add petsc install to CI-Ubuntu to test our PETSc wrapper
