Skip to content

59 cli bugfix

59 cli bugfix #71

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