77 pull_request :
88
99env :
10- RAVEN_TESTING_DATA_BRANCH : master
10+ RAVEN_TESTDATA_BRANCH : v2025.6.12
1111
1212concurrency :
1313 group : ${{ github.workflow }}-${{ github.ref }}
2222 runs-on : ubuntu-latest
2323 steps :
2424 - name : Harden Runner
25- uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12 .0
25+ uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13 .0
2626 with :
2727 disable-sudo : true
2828 egress-policy : block
@@ -68,29 +68,14 @@ jobs:
6868 tox-env : ' py3.10-coverage-upstream'
6969 steps :
7070 - name : Harden Runner
71- uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12 .0
71+ uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13 .0
7272 with :
73- egress-policy : block
74- allowed-endpoints : >
75- api.github.com:443
76- azure.archive.ubuntu.com:80
77- coveralls.io:443
78- esm.ubuntu.com:443
79- files.pythonhosted.org:443
80- github.com:443
81- motd.ubuntu.com:443
82- objects.githubusercontent.com:443
83- packages.microsoft.com:443
84- pavics.ouranos.ca:443
85- pypi.org:443
86- raw.githubusercontent.com:443
87- test.opendap.org:80
88-
73+ disable-sudo : false
74+ egress-policy : audit
8975 - name : Checkout Repository
9076 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9177 with :
9278 persist-credentials : false
93-
9479 - name : Set up Python${{ matrix.python-version }}
9580 uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
9681 with :
@@ -117,14 +102,32 @@ jobs:
117102 - name : Install CI libraries
118103 run : |
119104 python3 -m pip install --require-hashes -r CI/requirements_ci.txt
105+
106+ - name : Environment caching (macOS)
107+ if : matrix.os == 'macos-latest'
108+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
109+ with :
110+ path : |
111+ .tox
112+ ~/Library/Caches/raven-testdata
113+ key : ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-${{ matrix.os }}
114+ - name : Environment caching (Ubuntu)
115+ if : matrix.os == 'ubuntu-latest'
116+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
117+ with :
118+ path : |
119+ .tox
120+ ~/.cache/raven-testdata
121+ key : ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-${{ matrix.os }}
122+
120123 - name : Test with tox and report coverage
121124 run : |
122125 if [ "${{ matrix.tox-env }}" != "false" ]; then
123- python3 -m tox -e ${{ matrix.tox-env }}
126+ python3 -m tox -e ${{ matrix.tox-env }}-prefetch
124127 elif [ "${{ matrix.python-version }}" != "3.13" ]; then
125- python3 -m tox -e py${{ matrix.python-version }}-coverage
128+ python3 -m tox -e py${{ matrix.python-version }}-prefetch- coverage
126129 else
127- python3 -m tox -e py${{ matrix.python-version }}
130+ python3 -m tox -e py${{ matrix.python-version }}-prefetch
128131 fi
129132 env :
130133 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -148,21 +151,10 @@ jobs:
148151 shell : bash -l {0}
149152 steps :
150153 - name : Harden Runner
151- uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12 .0
154+ uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13 .0
152155 with :
153156 disable-sudo : true
154- egress-policy : block
155- allowed-endpoints : >
156- api.github.com:443
157- conda.anaconda.org:443
158- coveralls.io:443
159- files.pythonhosted.org:443
160- github.com:443
161- objects.githubusercontent.com:443
162- pavics.ouranos.ca:443
163- pypi.org:443
164- raw.githubusercontent.com:443
165- test.opendap.org:80
157+ egress-policy : audit
166158 - name : Checkout Repository
167159 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
168160 with :
@@ -172,7 +164,7 @@ jobs:
172164 run : |
173165 sed -i 's/climpred >=2.4.0/xesmf/' environment.yml
174166 - name : Setup Conda (Micromamba) with Python${{ matrix.python-version }}
175- uses : mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
167+ uses : mamba-org/setup-micromamba@b09ef9b599704322748535812ca03efb2625677b # v2.0.5
176168 with :
177169 cache-downloads : true
178170 cache-environment : true
@@ -187,13 +179,32 @@ jobs:
187179 run : |
188180 micromamba list
189181 python -m pip check || true
182+ - name : Cache test data (macOS)
183+ if : matrix.os == 'macos-latest'
184+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
185+ with :
186+ path : |
187+ ~/Library/Caches/raven-testdata
188+ key : ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-conda-${{ matrix.os }}
189+ - name : Cache test data (Ubuntu)
190+ if : matrix.os == 'ubuntu-latest'
191+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
192+ with :
193+ path : |
194+ ~/.cache/raven-testdata
195+ key : ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-conda-${{ matrix.os }}
196+
197+ - name : Prefetch RavenPy test data
198+ run : |
199+ python -c "import ravenpy.testing.utils as rtu; rtu.populate_testing_data()"
200+
190201 - name : Test RavenPy
191202 run : |
192203 python -m pytest --numprocesses=logical --cov=src/ravenpy --cov-report=lcov
193204 - name : Report Coverage
194205 uses : coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
195206 with :
196- flag-name : run-conda_ ${{ matrix.python-version }}_ ${{ matrix.os }}
207+ flag-name : run-${{ matrix.python-version }}- ${{ matrix.os }}-conda
197208 parallel : true
198209
199210 finish :
@@ -204,14 +215,10 @@ jobs:
204215 runs-on : ubuntu-latest
205216 steps :
206217 - name : Harden Runner
207- uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12 .0
218+ uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13 .0
208219 with :
209220 disable-sudo : true
210- egress-policy : block
211- allowed-endpoints : >
212- coveralls.io:443
213- github.com:443
214- objects.githubusercontent.com:443
221+ egress-policy : audit
215222 - name : Coveralls Finished
216223 uses : coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
217224 with :
0 commit comments