forked from ESMValGroup/ESMValCore
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (102 loc) · 4.45 KB
/
action-install-from-conda.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
# Install esmvalcore from PyPi on different OS's
# and different Python version; test locally with
# act: https://github.com/nektos/act
# Example how to setup conda workflows:
# https://github.com/marketplace/actions/setup-miniconda
# Notes:
# - you can group commands with | delimiter (or &&) but those will be run
# in one single call; declaring the shell variable makes the action run each
# command separately (better for debugging);
# - can try multiple shells eg pwsh or cmd /C CALL {0} (but overkill for now!);
# TODO: read the cron tasking documentation:
# https://www.netiq.com/documentation/cloud-manager-2-5/ncm-reference/data/bexyssf.html
name: Conda Base Install
# runs on a push on master and at the end of every day
on:
# triggering on push without branch name will run tests everytime
# there is a push on any branch
# turn it on only if needed
push:
branches:
- master
# run the test only if the PR is to master
# turn it on if required
#pull_request:
# branches:
# - master
schedule:
- cron: '0 4 * * *'
jobs:
linux:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
# fail-fast set to False allows all other tests
# in the worflow to run regardless of any fail
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniconda-version: "latest"
channels: conda-forge
- shell: bash -l {0}
run: mkdir -p conda_install_linux_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda --version 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: which conda 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/conda_path.txt
- shell: bash -l {0}
run: python -V 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: conda install esmvalcore 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
- name: Upload artifacts
if: ${{ always() }} # upload artifacts even if fail
uses: actions/upload-artifact@v2
with:
name: Conda_Install_Linux_python_${{ matrix.python-version }}
path: conda_install_linux_artifacts_python_${{ matrix.python-version }}
osx:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: esmvalcore
python-version: ${{ matrix.python-version }}
miniconda-version: "latest"
channels: conda-forge
- shell: bash -l {0}
run: mkdir -p conda_install_osx_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda update -n base -c defaults conda
- shell: bash -l {0}
run: conda --version 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: which conda 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/conda_path.txt
- shell: bash -l {0}
run: python -V 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: conda install esmvalcore 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/version.txt
- name: Upload artifacts
if: ${{ always() }} # upload artifacts even if fail
uses: actions/upload-artifact@v2
with:
name: Conda_Install_OSX_python_${{ matrix.python-version }}
path: conda_install_osx_artifacts_python_${{ matrix.python-version }}