-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (53 loc) · 2.21 KB
/
create-gfdl-catalog.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
name: create-gfdl-catalog
#This actions workflow generates sample input directory structure/files (empty ATM) on the fly
#runs catalog builder to generate a csv file and the json file which is also cached and saved as an artifact for reference in the
#actions pipeline. We download the artifacts and use them in the dynamic pytests.
#pytests are run, which also comprises of one test that runs intake-esm open calls on the dynamic catalog (corresponding
#esm collection spec is in the repo
on:
pull_request:
branches:
- 'main'
jobs:
catalog-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env create -f environment.yml --name catalogbuilder
- name: Make sample data
run: python tests/make_sample_data.py
- name: 'Generate catalog'
run: |
$CONDA/envs/catalogbuilder/bin/python scripts/gen_intake_gfdl.py archive/am5/am5/am5f3b1r0/c96L65_am5f3b1r0_pdclim1850F/gfdl.ncrc5-deploy-prod-openmp/pp cats/gfdl_autotest
- name: 'Generate catalog with yaml'
run: |
$CONDA/envs/catalogbuilder/bin/python scripts/gen_intake_gfdl.py --config tests/test_config.yaml
- name: upload-artifacts1
uses: actions/upload-artifact@v4
with:
name: workflow-artifacts1
path: |
cats/gfdl_autotest.csv
cats/gfdl_autotest.json
cats/gfdl_autotest_from_yaml.csv
cats/gfdl_autotest_from_yaml.json
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Test with pytest
run: |
conda install pytest
$CONDA/envs/catalogbuilder/bin/pytest -v --runxfail
- name: Test for completeness
run: |
$CONDA/envs/catalogbuilder/bin/python tests/test_catalog.py -tf cats/gfdl_autotest.json
$CONDA/envs/catalogbuilder/bin/python tests/test_catalog.py -tf cats/gfdl_autotest_from_yaml.json