Skip to content

mkatmsrffile

mkatmsrffile #8

name: mkatmsrffile
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
paths:
- 'components/eam/tools/mkatmsrffile/mkatmsrffile.py'
schedule:
- cron: '00 15 * * 2'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
mkatmsrffile-test:
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
outputs:
event_name: ${{ github.event_name }}
steps:
-
name: Repository checkout
uses: actions/checkout@v4
with:
show-progress: false
submodules: false
-
name: Conda setup
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "envmkatmsrffile"
miniforge-version: latest
channel-priority: strict
auto-update-conda: true
python-version: 3.11
-
name: Install dependencies
run: |
echo $CONDA_PREFIX
conda install -y nco xarray numba numpy netcdf4 -c conda-forge
-
name: Run tests
working-directory: components/eam/tools/mkatmsrffile
run: |
echo $CONDA_PREFIX
wget https://web.lcrc.anl.gov/public/e3sm/inputdata/atm/cam/chem/trop_mozart/dvel/clim_soilw.nc
wget https://web.lcrc.anl.gov/public/e3sm/inputdata/atm/cam/chem/trop_mozart/dvel/regrid_vegetation.nc
wget https://web.lcrc.anl.gov/public/e3sm/inputdata/atm/cam/chem/trop_mozart/dvel/map_1x1_to_ne30pg2_traave_c20240903.nc
python mkatmsrffile.py --map_file=map_1x1_to_ne30pg2_traave_c20240903.nc --vegetation_file=regrid_vegetation.nc --soil_water_file=clim_soilw.nc --dst_grid=ne30pg2
mkatmsrffile-notify:
needs: mkatmsrffile-test
if: ${{ failure() && needs.mkatmsrffile-test.outputs.event_name != 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Create issue
run: |
previous_issue_number=$(gh issue list \
--label "$LABELS" \
--json number \
--jq '.[0].number')
if [[ -n $previous_issue_number ]]; then
gh issue comment "$previous_issue_number" \
--body "$BODY"
else
gh issue create \
--title "$TITLE" \
--assignee "$ASSIGNEES" \
--label "$LABELS" \
--body "$BODY"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TITLE: mkatmsrffile test failure
ASSIGNEES: whannah1
LABELS: bug,notify-mkatmsrffile-gh-action
BODY: |
Workflow failed! There's likely an issue in the mkatmsrffile tool! For more information, please see:
- Workflow URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (number ${{ github.run_number }}, attempt ${{ github.run_attempt }})
- Workflow SHA: ${{ github.sha }}