|
| 1 | +name: Test recipes |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: '0 4 * * *' |
| 8 | + |
| 9 | +jobs: |
| 10 | + install-esmvaltool-and-run-recipes: |
| 11 | + runs-on: "ubuntu-latest" |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - name: Cache conda |
| 15 | + uses: actions/cache@v1 |
| 16 | + env: |
| 17 | + # Increase this value to reset cache if files/recipe_example.yml has not changed |
| 18 | + CACHE_NUMBER: 1 |
| 19 | + with: |
| 20 | + path: ~/conda_pkgs_dir |
| 21 | + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('files/recipe_example.yml') }} |
| 22 | + - uses: conda-incubator/setup-miniconda@v2 |
| 23 | + with: |
| 24 | + python-version: "3.9" |
| 25 | + miniconda-version: "latest" |
| 26 | + channels: conda-forge |
| 27 | + - name: Install mamba |
| 28 | + shell: bash -l {0} |
| 29 | + run: conda install mamba |
| 30 | + - name: Install esmvaltool from conda |
| 31 | + shell: bash -l {0} |
| 32 | + run: mamba install esmvaltool |
| 33 | + # this step is currently unnecessary; might be useful depending on config customizations |
| 34 | + - name: Get config-user file |
| 35 | + shell: bash -l {0} |
| 36 | + run: esmvaltool config get_config_user |
| 37 | + ################################# |
| 38 | + # turning off local data caching since we turned on auto ESGF data download |
| 39 | + ################################# |
| 40 | + #- name: Cache datasets |
| 41 | + # uses: actions/cache@v1 |
| 42 | + # env: |
| 43 | + # # Increase this value to reset cache if data/dataset.urls has not changed |
| 44 | + # CACHE_NUMBER: 0 |
| 45 | + # with: |
| 46 | + # path: ~/climate_data |
| 47 | + # key: ${{ runner.os }}-datasets-${{ env.CACHE_NUMBER }}-${{ hashFiles('data/dataset.urls') }} |
| 48 | + #- name: Download dataset files for episodes 4 and 5 |
| 49 | + # shell: bash -l {0} |
| 50 | + # run: | |
| 51 | + # head -4 data/dataset.urls | grep -v '#' | wget --input-file - --no-clobber --no-verbose --directory-prefix $HOME/climate_data/ |
| 52 | + ###################################### |
| 53 | + # recipe fluxcom is not running since it needs OBS6 data, unavailable for download |
| 54 | + ###################################### |
| 55 | + - name: Run all warming stripes recipes in files/ |
| 56 | + shell: bash -l {0} |
| 57 | + run: | |
| 58 | + mkdir ~/esmvaltool_tutorial |
| 59 | + cp files/warming_stripes.py ~/esmvaltool_tutorial/ |
| 60 | + for file in files/recipe_warming_stripes*.yml; do $CONDA/envs/test/bin/esmvaltool run $PWD/$file --offline=False; done |
0 commit comments