-
Notifications
You must be signed in to change notification settings - Fork 55
86 lines (83 loc) · 2.94 KB
/
e3sm-gh-tools-mkatmsrffile-test.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: mkatmsrffile
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
paths:
- 'components/eam/tools/mkatmsrffile/mkatmsrffile.py'
schedule:
- cron: '00 15 * * 2'
workflow_dispatch:
jobs:
mkatmsrffile-test:
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-variant: Mambaforge
miniforge-version: latest
use-mamba: true
mamba-version: "*"
channel-priority: strict
auto-update-conda: true
python-version: 3.11
-
name: Install dependencies
run: |
echo $CONDA_PREFIX
mamba install -y nco xarray numba numpy netcdf4
-
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 }}