Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/esgf_qa_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: esgf_qa_check
on:
push:
branches:
- main
pull_request:
branches:

# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
esgf-qa-validation:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: fremorizer
environment-file: environment.yaml
auto-activate-base: false
miniforge-version: latest

- name: Configure Conda
run: |
echo "removing main and r channels from defaults"
conda config --remove channels defaults || true
conda config --remove channels main || true
conda config --remove channels r || true

echo "setting strict channel priority"
conda config --set channel_priority strict

echo "printing conda config just in case"
conda config --show

- name: Install fremorizer
run: |
pip install .

- name: Run pytest to generate test outputs
run: |
pytest fremorizer/tests/ -v --tb=short

- name: Run ESGF-QA on test outputs
run: |
# Find the test output directory
TEST_OUTPUT_DIR="fremorizer/tests/test_files/outdir"

# Create directory for QA results
QA_RESULTS_DIR="esgf_qa_results"
mkdir -p ${QA_RESULTS_DIR}

# Check if test outputs exist
if [ -d "${TEST_OUTPUT_DIR}" ] && [ -n "$(find ${TEST_OUTPUT_DIR} -name '*.nc' -print -quit)" ]; then
echo "Running ESGF-QA on test outputs in ${TEST_OUTPUT_DIR}"

# Run ESGF-QA with CF compliance checks
esgqa -t cf:latest -o ${QA_RESULTS_DIR} -i "fremorizer-test-outputs" ${TEST_OUTPUT_DIR} || true

echo "ESGF-QA check completed"
echo "Results stored in ${QA_RESULTS_DIR}"

# Display summary of results
if [ -f "${QA_RESULTS_DIR}/qa_result_"*.cluster.json ]; then
echo "QA results summary:"
ls -lh ${QA_RESULTS_DIR}/qa_result_*.cluster.json
fi
else
echo "No test output files found in ${TEST_OUTPUT_DIR}"
echo "Skipping ESGF-QA validation"
fi

- name: Upload ESGF-QA results
if: always()
uses: actions/upload-artifact@v4
with:
name: esgf-qa-results-py${{ matrix.python-version }}
path: esgf_qa_results/
retention-days: 30
if-no-files-found: warn
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ cython_debug/
tmp/

# QA results
esgf_qa_results/
wcrp_compliance_reports/

# autogen'd by doc build
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[![pylint](https://img.shields.io/badge/pylint-%E2%89%A59.6-brightgreen)](https://github.com/NOAA-GFDL/epmt/actions/workflows/build_and_test_epmt.yml)
[![codecov](https://codecov.io/gh/ilaflott/fremorizer/branch/main/graph/badge.svg)](https://codecov.io/gh/ilaflott/fremorizer)

[![esgf_qa_check](https://github.com/ilaflott/fremorizer/actions/workflows/esgf_qa_check.yml/badge.svg?branch=main)](https://github.com/ilaflott/fremorizer/actions/workflows/esgf_qa_check.yml)

Check warning on line 13 in README.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (esgf)

Simply put, `fremorizer` CMORizes FRE output with `CMOR`.

Expand Down Expand Up @@ -174,6 +175,24 @@

## Quality Assurance

The repository includes automated quality assurance (QA) checks to validate that CMORized outputs meet CMIP6 standards:

### ESGF-QA Validation

Check warning on line 180 in README.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ESGF)

The `esgf_qa_check` workflow runs [ESGF-QA](https://github.com/ESGF/esgf-qa) on test outputs to verify CF compliance and CMIP6 metadata standards. This separate pipeline:

Check warning on line 182 in README.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ESGF)

Check warning on line 182 in README.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (esgf)

- Runs automatically on pushes and pull requests
- Executes unit tests to generate CMORized output files
- Validates outputs using ESGF-QA with CF compliance checks
- Uploads QA results as workflow artifacts (retained for 30 days)

To view QA results from a workflow run:
1. Navigate to the Actions tab in GitHub
2. Select the `esgf_qa_check` workflow run
3. Download the `esgf-qa-results` artifact
4. View results using the ESGF-QA viewer or web interface

## Relationship to fre-cli
### WCRP Compliance Checking

[![wcrp_compliance_check](https://github.com/ilaflott/fremorizer/actions/workflows/wcrp_compliance_check.yml/badge.svg?branch=main)](https://github.com/ilaflott/fremorizer/actions/workflows/wcrp_compliance_check.yml)
Expand Down
3 changes: 3 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
- conda-forge::pytest
- conda-forge::pytest-cov
- conda-forge::pylint
- pip
- pip:
- esgf-qa

Check warning on line 17 in environment.yaml

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (esgf)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
]

qa = [
"esgf-qa",

Check warning on line 64 in pyproject.toml

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (esgf)
"cc-plugin-wcrp",
]

Expand Down
Loading