-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (48 loc) · 1.7 KB
/
python-package-conda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build hydrodiy
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_hydrodiy.yml
- name : Install hydrodiy package in conda env
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_hydrodiy
pip install -e .
- name: Run tests
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_hydrodiy
pytest --cov=hydrodiy --cov-config=.coveragerc --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html src/hydrodiy
- 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 to codecov
uses: codecov/codecov-action@v3
- name: Run examples
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate env_hydrodiy
python examples/run_all_examples.py