Skip to content

Commit b502a77

Browse files
committed
add test GHA
1 parent 9e964e3 commit b502a77

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/run-tests.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- add_test_GHA
8+
schedule:
9+
- cron: '0 0 * * *' # nightly
10+
11+
# Required shell entrypoint to have properly configured bash shell
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
16+
jobs:
17+
linux:
18+
runs-on: "ubuntu-latest"
19+
if: github.repository == 'ESMValGroup/ESMValTool_sample_data' # avoid GAs in forks
20+
strategy:
21+
matrix:
22+
python-version: ["3.10", "3.11", "3.12", "3.13"]
23+
fail-fast: false
24+
name: Linux Python ${{ matrix.python-version }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
- uses: conda-incubator/setup-miniconda@v3
30+
with:
31+
activate-environment: esmvaltool_test_data
32+
environment-file: environment.yml
33+
python-version: ${{ matrix.python-version }}
34+
miniforge-version: "latest"
35+
use-mamba: true
36+
- run: conda -V
37+
- run: python -V
38+
- run: conda list
39+
- run: pip install -e .
40+
- run: conda list
41+
- run: pytest -n 2
42+
43+
osx:
44+
runs-on: "macos-latest"
45+
if: github.repository == 'ESMValGroup/ESMValTool_sample_data' # avoid GAs in forks
46+
strategy:
47+
matrix:
48+
python-version: ["3.10", "3.11", "3.12", "3.13"]
49+
architecture: ["x64"] # need to force Intel, arm64 builds have issues
50+
fail-fast: false
51+
name: OSX Python ${{ matrix.python-version }}
52+
steps:
53+
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
- uses: conda-incubator/setup-miniconda@v3
57+
with:
58+
architecture: ${{ matrix.architecture }}
59+
activate-environment: esmvaltool_test_data
60+
environment-file: environment.yml
61+
python-version: ${{ matrix.python-version }}
62+
miniforge-version: "latest"
63+
use-mamba: true
64+
- run: conda -V
65+
- run: python -V
66+
- run: conda list
67+
- run: pip install -e .
68+
- run: conda list
69+
- run: pytest -n 2

0 commit comments

Comments
 (0)