Skip to content
34 changes: 19 additions & 15 deletions .github/workflows/python_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,52 @@ on: [push]

jobs:
pytest:
name: pytest for py${{ matrix.python-version }}
name: pytest for py${{ matrix.python-version }} on ${{ matrix.os }}

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install gmsh
run: |
sudo apt-get install -y python3-gmsh

- name: Setup Ubuntu environment
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y python3-gmsh libglu1
- name: Setup MacOS environment
if: startsWith(matrix.os, 'macos')
run: brew install gmsh

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install flake8 pytest pytest-cov coveralls
- name: Setup Linux Environment
run: |
sudo apt-get install libglu1
- name: Install package requirements
run: pip install -r requirements.txt
- name: Install package
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
run: pip install -e .

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src tests setup.py --exclude=__init__.py --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src tests setup.py --exclude=__init__.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov=src tests/
run: pytest --cov=src tests/

- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
coveralls
COVERALLS_FLAG_NAME: py${{ matrix.python-version }} on ${{ matrix.os }}
run: coveralls

package-checks:
name: package checks
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gmsh==4.6.0.post2
gmsh==4.10.5
matplotlib==3.5.1
numpy==1.22.0
pybind11==2.4.3
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aabbtree==2.5.0
matplotlib==3.3.4
matplotlib==3.5.3
pybind11==2.4.3
pygmsh==7.0.2
MeshPy==2018.2.1
Expand Down