forked from ESMValGroup/ESMValCore
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (86 loc) · 3.47 KB
/
run-tests-monitor.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
---
name: Monitor Tests
on:
push:
branches:
- main
# run the test only if the PR is to main
# turn it on if required
#pull_request:
# branches:
# - main
schedule:
- cron: '0 0 * * *' # nightly
# Required shell entrypoint to have properly configured bash shell
defaults:
run:
shell: bash -l {0}
jobs:
linux:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: esmvalcore
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- run: mkdir -p test_linux_artifacts_python_${{ matrix.python-version }}
- run: conda --version 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- run: python -V 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- run: pip install pytest-monitor
- run: pip install -e .[develop] 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- run: pytest -n 2 -m "not installation" --db ../.pymon 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/test_report.txt
- run: python tests/parse_pymon.py
- name: Upload artifacts
if: ${{ always() }} # upload artifacts even if fail
uses: actions/upload-artifact@v4
with:
name: Test_Linux_python_${{ matrix.python-version }}
path: test_linux_artifacts_python_${{ matrix.python-version }}
osx:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
architecture: ["x64"] # need to force Intel, arm64 builds have issues
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
architecture: ${{ matrix.architecture }}
activate-environment: esmvalcore
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- run: mkdir -p test_osx_artifacts_python_${{ matrix.python-version }}
- run: conda --version 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- run: python -V 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
- run: mamba install -c conda-forge git
- run: pip install pytest-monitor
- run: pip install -e .[develop] 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- run: conda list
- run: pytest -n 2 -m "not installation" --db ../.pymon 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/test_report.txt
- run: python tests/parse_pymon.py
- name: Upload artifacts
if: ${{ always() }} # upload artifacts even if fail
uses: actions/upload-artifact@v4
with:
name: Test_OSX_python_${{ matrix.python-version }}
path: test_osx_artifacts_python_${{ matrix.python-version }}