Skip to content

Bump the actions group in /.github/workflows with 14 updates #2177

Bump the actions group in /.github/workflows with 14 updates

Bump the actions group in /.github/workflows with 14 updates #2177

Workflow file for this run

name: RavenPy
on:
push:
branches:
- master
pull_request:
env:
RAVEN_TESTDATA_BRANCH: v2025.6.12
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
permissions:
contents: read
jobs:
lint:
name: Code linting
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.x"
cache: pip
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment Caching
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
.tox
key: ${{ hashFiles('pyproject.toml', 'tox.ini') }}-lint
- name: Run linting suite
run: |
python -m tox -e lint
pip:
name: Test with Python${{ matrix.python-version }} (tox, ${{ matrix.os }}), upstream=${{ matrix.upstream-branch }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', "macos-latest" ]
python-version: [ "3.11", "3.12", "3.13" ]
tox-env: [ 'false' ]
include:
- os: 'ubuntu-latest'
python-version: '3.10'
tox-env: 'py3.10-coverage-upstream'
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
disable-sudo: false
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install GDAL + Set GDAL_VERSION (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libgdal-dev
echo "GDAL_VERSION=$(gdal-config --version)" >> $GITHUB_ENV
- name: Install GDAL (macOS)
if: matrix.os == 'macos-latest'
uses: tecolicom/actions-use-homebrew-tools@b9c066b79607fa3d71e0be05d7003bb75fd9ff34 # v1.3
with:
tools: gdal
cache: "yes"
- name: Set GDAL_VERSION (macOS)
if: matrix.os == 'macos-latest'
run: |
echo "GDAL_VERSION=$(gdalinfo --version | sed -E 's/^GDAL //; s/[^0-9.].*$//')" >> $GITHUB_ENV
- name: Install CI libraries
run: |
python3 -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment caching (macOS)
if: matrix.os == 'macos-latest'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
.tox
~/Library/Caches/raven-testdata
key: ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-${{ matrix.os }}
- name: Environment caching (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
.tox
~/.cache/raven-testdata
key: ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-${{ matrix.os }}
- name: Test with tox and report coverage
run: |
if [ "${{ matrix.tox-env }}" != "false" ]; then
python3 -m tox -e ${{ matrix.tox-env }}-prefetch
elif [ "${{ matrix.python-version }}" != "3.13" ]; then
python3 -m tox -e py${{ matrix.python-version }}-prefetch-coverage
else
python3 -m tox -e py${{ matrix.python-version }}-prefetch
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-Python${{ matrix.python-version }}-${{ matrix.os }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
UPSTREAM_BRANCH: ${{ matrix.upstream-branch }}
conda:
name: Test with Python${{ matrix.python-version }} (Anaconda, ${{ matrix.os }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
# - windows-latest # disabled until xesmf is available
python-version: [ "3.10", "3.13" ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
disable-sudo: true
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Patch Environment File
if: matrix.os == 'windows-latest'
run: |
sed -i 's/climpred >=2.4.0/xesmf/' environment.yml
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7
with:
cache-downloads: true
cache-environment: true
cache-environment-key: environment-${{ matrix.python-version }}-${{ matrix.os }}-${{ github.head_ref }}
environment-file: environment-dev.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Install RavenPy
run: |
python -m pip install -e ".[dev,gis]"
- name: List installed packages
run: |
micromamba list
python -m pip check || true
- name: Cache test data (macOS)
if: matrix.os == 'macos-latest'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/Library/Caches/raven-testdata
key: ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-conda-${{ matrix.os }}
- name: Cache test data (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cache/raven-testdata
key: ${{ hashFiles('src/ravenpy/testing/registry.txt') }}-${{ env.RAVEN_TESTDATA_BRANCH }}-conda-${{ matrix.os }}
- name: Prefetch RavenPy test data
run: |
python -c "import ravenpy.testing.utils as rtu; rtu.populate_testing_data()"
- name: Test RavenPy
run: |
python -m pytest --numprocesses=logical --cov=src/ravenpy --cov-report=lcov
- name: Report Coverage
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
flag-name: run-${{ matrix.python-version }}-${{ matrix.os }}-conda
parallel: true
finish:
name: Finish
needs:
- pip
- conda
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
disable-sudo: true
egress-policy: audit
- name: Coveralls Finished
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
parallel-finished: true