Skip to content

Commit e0f9a61

Browse files
add test Github Action (#30)
* add test GHA * one proc pytest rather than add xdist * Update .github/workflows/run-tests.yml
1 parent 9e964e3 commit e0f9a61

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/run-tests.yml

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

0 commit comments

Comments
 (0)