Skip to content

Fix/tests

Fix/tests #376

Workflow file for this run

name: pylbo
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
env:
CC: /usr/bin/gcc-10
FC: /usr/bin/gfortran-10
LEGOLASDIR: /home/runner/work/legolas/legolas
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black
- name: Run flake8
run: |
flake8 --count --exclude=__init__.py --extend-ignore=E203,W503 --max-line-length=88 --show-source --statistics post_processing/
flake8 --count --exclude=__init__.py --extend-ignore=E203,W503 --max-line-length=88 --show-source --statistics tests/pylbo_tests/
flake8 --count --exclude=__init__.py --extend-ignore=E203,W503 --max-line-length=88 --show-source --statistics tests/regression_tests/
- name: Run black
run: |
black --diff --check post_processing/
black --diff --check tests/regression_tests/
black --diff --check tests/pylbo_tests/
tests:
runs-on: ubuntu-latest
needs: style
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
sudo apt-get update
sudo apt-get install ffmpeg
pip install matplotlib=3.9.2
pip install numpy=2.0.2
cd post_processing
python setup.py develop
- name: Install Legolas dependencies
run: |
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
sudo apt-get install lcov
gfortran-10 --version
cmake --version
- name: Compile Legolas
run: |
mkdir build
cd build
cmake ..
make -j 2
- name: Run Pylbo tests
run: |
mkdir -p coverage/pylbo
cd $LEGOLASDIR/tests/pylbo_tests
cp .coveragerc $LEGOLASDIR/coverage/pylbo
pytest -v --cov=pylbo
cd $LEGOLASDIR/coverage/pylbo
coverage xml
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
files: ./coverage/pylbo/coverage.xml
flags: pylbo