Skip to content

fix: fixed style

fix: fixed style #60

name: Build pyquasoare
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Create conda environment if needed
run: |
source $CONDA/etc/profile.d/conda.sh
conda env create -f env_pyquasoare.yml
- name : Install hydrodiy package in conda env
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_pyquasoare
cd $GITHUB_WORKSPACE
mkdir -p src
cd src
git clone https://github.com/csiro-hydroinformatics/hydrodiy.git
cd hydrodiy
echo "--- hydrodiy install : located in $PWD ---"
pip install -e .
- name : Install pygme package in conda env
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_pyquasoare
cd $GITHUB_WORKSPACE
mkdir -p src
cd src
git clone https://github.com/csiro-hydroinformatics/pygme.git
cd pygme
echo "--- pygme install : located in $PWD ---"
pip install -e .
- name : Install pyquasoare package in conda env
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_pyquasoare
cd $GITHUB_WORKSPACE
echo "--- pyquasoare install : located in $PWD ---"
pip install -e .
- name: Lint with flake8
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_pyquasoare
cd $GITHUB_WORKSPACE
flake8 src/pyquasoare
- name: Run tests
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_pyquasoare
cd $GITHUB_WORKSPACE
echo "--- pyquasoare test : located in $PWD ---"
pytest --ignore=src/pygme --ignore=src/hydrodiy --doctest-modules src
pytest --ignore=src/pygme --ignore=src/hydrodiy --ntry=100 --cov=pyquasoare --cov-config=.coveragerc --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html tests
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results
path: junit/test-results.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Upload pytest test log files
uses: actions/upload-artifact@v3
with:
name: pytest-logs
path: tests/*.log
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run examples
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_pyquasoare
cd $GITHUB_WORKSPACE
echo "--- pyquasoare examples : located in $PWD ---"
python examples/run_all_examples.py
cd examples/quadroute
./compile_unix.sh
cd ../vicmod
./compile_unix.sh