generated from NOAA-GFDL/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (54 loc) · 2.19 KB
/
conda-env-create-run-pytest.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
name: conda-env-create-run-pytest
on: [pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
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: Create catalogbuilder conda environment
run: |
# create environment catalogbuilder will be installed into
conda env create -f environment.yml --name catalogbuilder
# put conda env binaries in GITHUB_PATH
echo $CONDA/envs/catalogbuilder/bin >> $GITHUB_PATH
# install catalogbuilder to conda env directories
$CONDA/envs/catalogbuilder/bin/python -m pip install --prefix $CONDA/envs/catalogbuilder .
- name: Make sample data
run: |
which python
python catalogbuilder/tests/make_sample_data.py
- name: Generate catalog
run: |
which python
python catalogbuilder/scripts/gen_intake_gfdl.py archive/am5/am5/am5f3b1r0/c96L65_am5f3b1r0_pdclim1850F/gfdl.ncrc5-deploy-prod-openmp/pp gfdl_autotest
- name: Generate catalog with yaml
run: |
which python
python catalogbuilder/scripts/gen_intake_gfdl.py --config catalogbuilder/tests/test_config.yaml
- name: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: workflow-artifacts1
path: |
catalogbuilder/cats/gfdl_autotest_from_yaml.json
catalogbuilder/cats/gfdl_autotest_from_yaml.csv
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Run pytest with downloaded artifacts
run: |
$CONDA/envs/catalogbuilder/bin/pytest -v --runxfail catalogbuilder
- name: Test for completeness
run: |
which python
python catalogbuilder/scripts/test_catalog.py -tf gfdl_autotest.json catalogbuilder/cats/gfdl_template.json
python catalogbuilder/scripts/test_catalog.py -tf catalogbuilder/cats/gfdl_autotest_from_yaml.json