-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (95 loc) · 3.6 KB
/
tests.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Testing
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
setup-build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: [3.8, 3.9, "3.10", "3.11"]
# python-version: ["3.10", ]
steps:
- uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
activate-environment: aurora-test
python-version: ${{ matrix.python-version }}
- name: Install Env
run: |
python --version
conda install -c conda-forge pytest pytest-cov certifi">=2017.4.17" pandoc
pip install -r requirements-dev.txt
pip install git+https://github.com/kujaku11/mt_metadata.git@main
pip install git+https://github.com/kujaku11/mth5.git@master
pip install git+https://github.com/MTgeophysics/mtpy-v2.git@main
pip uninstall aurora -y
- name: Install Our Package
run: |
pip install -e .
conda list
pip freeze
- name: Install Jupyter and dependencies
run: |
pip install jupyter
pip install ipykernel
python -m ipykernel install --user --name aurora-test
# Install any other dependencies you need
- name: Execute Jupyter Notebooks
run: |
jupyter nbconvert --to notebook --execute docs/examples/dataset_definition.ipynb
jupyter nbconvert --to notebook --execute docs/examples/operate_aurora.ipynb
jupyter nbconvert --to notebook --execute docs/tutorials/pkd_units_check.ipynb
jupyter nbconvert --to notebook --execute docs/tutorials/pole_zero_fitting/lemi_pole_zero_fitting_example.ipynb
jupyter nbconvert --to notebook --execute docs/tutorials/processing_configuration.ipynb
jupyter nbconvert --to notebook --execute docs/tutorials/process_cas04_multiple_station.ipynb
jupyter nbconvert --to notebook --execute docs/tutorials/synthetic_data_processing.ipynb
jupyter nbconvert --to notebook --execute tests/test_run_on_commit.ipynb
# Replace "notebook.ipynb" with your notebook's filename
# - name: Commit changes (if any)
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git commit -a -m "Execute Jupyter notebook"
# git push
# if: ${{ success() }}
- name: Run Tests
run: |
# pytest -s -v tests/synthetic/test_fourier_coefficients.py
# pytest -s -v tests/test_general_helper_functions.py
pytest -s -v --cov=./ --cov-report=xml --cov=aurora
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@v4
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: tests
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Build Doc
if: ${{ (github.ref == 'refs/heads/main') && (matrix.python-version == '3.8')}}
run: |
cd docs
make html
cd ..
- name: GitHub Pages
if: ${{ (github.ref == 'refs/heads/main') && (matrix.python-version == '3.8')}}
uses: crazy-max/[email protected]
with:
build_dir: docs/_build/html
# Write the given domain name to the CNAME file
# fqdn: aurora.simpeg.xyz
# Allow Jekyll to build your site
jekyll: false # optional, default is true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}