-
Notifications
You must be signed in to change notification settings - Fork 38
74 lines (66 loc) · 2 KB
/
Copy pathtests.yml
File metadata and controls
74 lines (66 loc) · 2 KB
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
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.10"]
test_file: [
"tests/test_dcip.py",
"tests/test_em.py",
"tests/test_gpr.py tests/test_seismic.py",
"tests/test_inversion.py",
"tests/test_gravity.py tests/test_mag.py"
]
env:
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
MPLBACKEND: Agg # avoid GUI backends import cost
steps:
- uses: actions/checkout@v4
# Use Miniforge3 (not "latest" to avoid 404s) + mamba, strict conda-forge
- name: Setup Conda (Miniforge3 + mamba)
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: "24.11.0-0" # pin to avoid 'latest' asset 404s
python-version: ${{ matrix.python-version }}
activate-environment: geosci-labs-dev
environment-file: environment-dev.yml
use-mamba: true
auto-update-conda: false
auto-activate-base: false
channels: conda-forge
channel-priority: strict
condarc: |
channels:
- conda-forge
channel_priority: strict
- name: Show environment info
run: |
conda info
conda list
- name: Install geosci-labs
run: |
pip install -e .
- name: Install test dependencies (pytest + testipynb)
run: |
n=0
until [ $n -ge 3 ]; do
mamba install -y pytest && pip install -U testipynb && break
n=$((n+1))
echo "Retry $n/3 after transient fetch error..."
sleep 10
done
- name: Run tests
run: pytest -v ${{ matrix.test_file }}