Update conda-env-create-and-pytest.yml #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: conda-env-create-and-pytest | |
on: [push] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
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: Create catalogbuilder environment | |
run: | | |
# create environment catalogbuilder will be installed into | |
conda env create -f environment.yml --name catalogbuilder | |
# install catalogbuilder | |
pip install . | |
- name: Run pytest in catalogbuilder environment | |
run: | | |
which python | |
python --version | |
$CONDA/envs/catalogbuilder/bin/python --version | |
# which pytest | |
$CONDA/envs/catalogbuilder/bin/pytest | |
- name: Make sample data | |
run: | | |
python tests/make_sample_data.py | |
- name: Generate catalog | |
run: | | |
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: | | |
python catalogbuilder/scripts/gen_intake_gfdl.py --config tests/test_config.yaml | |
- name: upload-artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: workflow-artifacts1 | |
path: | | |
gfdl_autotest.csv | |
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: Run pytest with downloaded artifacts | |
run: | | |
$CONDA/envs/catalogbuilder/bin/pytest -v --runxfail | |
- name: Test for completeness | |
run: | | |
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 |