Skip to content

Bump mamba-org/setup-micromamba from 1.9.0 to 2.0.0 #243

Bump mamba-org/setup-micromamba from 1.9.0 to 2.0.0

Bump mamba-org/setup-micromamba from 1.9.0 to 2.0.0 #243

Workflow file for this run

name: raven-hydro Testing Suite
on:
push:
branches:
- main
pull_request:
concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on main.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
black:
name: Code linting
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Setup Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.x"
cache: "pip"
- name: Run pre-commit hooks
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
build:
name: Python${{ matrix.python-version }} (${{ matrix.os }}, conda=${{ matrix.conda }}, args=${{ matrix.install_args }})
needs: black
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.2"]
os:
- ubuntu-latest
# - macos-latest # macOS with Apple Silicon is not supported yet
conda: [ false ]
install_args: [ "" ]
include:
- python-version: "3.8"
os: windows-latest
conda: true
- python-version: "3.9"
os: ubuntu-latest
conda: true
- python-version: "3.10"
os: ubuntu-latest
conda: true
- python-version: "3.10"
os: windows-latest
conda: true
# - python-version: "3.10" # macOS with Apple Silicon is not supported yet
# os: macos-latest
# conda: true
- python-version: "3.11"
os: ubuntu-latest
conda: false
install_args: "-Ccmake.define.USE_NETCDF=false"
- python-version: "3.12"
os: ubuntu-latest
conda: true
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
submodules: true
- name: Setup Python${{ matrix.python-version }}
if: ${{ !matrix.conda }}
id: pyinstalled
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Set up Python${{ matrix.python-version }} with NetCDF4 (conda)
if: ${{ matrix.conda }}
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0
with:
cache-downloads: true
cache-environment: true
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0).
- name: Install NetCDF4 (Ubuntu/apt)
if: (matrix.os == 'ubuntu-latest') && (!matrix.install_args) && (!matrix.conda)
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev
- name: Install NetCDF4 (macOS/homebrew)
if: (matrix.os == 'macos-latest') && (!matrix.conda)
uses: tecolicom/actions-use-homebrew-tools@b9c066b79607fa3d71e0be05d7003bb75fd9ff34 # v1.3.0
with:
tools: netcdf
cache: "yes"
- name: Check for OPeNDAP Support
if: (!matrix.install_args)
run: |
nc-config --has-dap
- name: Install raven-hydro
if: ${{ !matrix.conda }}
run: |
${{ steps.pyinstalled.outputs.python-path }} -m pip install --editable . ${{ matrix.install_args }}
- name: Check versions
if: ${{ !matrix.conda }}
run: |
${{ steps.pyinstalled.outputs.python-path }} -m pip list
${{ steps.pyinstalled.outputs.python-path }} -m pip check || true
- name: Test raven-hydro
if: ${{ !matrix.conda }}
run: |
${{ steps.pyinstalled.outputs.python-path }} -c "import raven_hydro; print(f'Description: {raven_hydro.__doc__}')"
${{ steps.pyinstalled.outputs.python-path }} -c "import raven_hydro; print(f'Built with netcdf: {raven_hydro.__netcdf__}')"
${{ steps.pyinstalled.outputs.python-path }} -c "import raven_hydro; print(f'RavenHydroFramework version: {raven_hydro.__raven_version__}')"
${{ steps.pyinstalled.outputs.python-path }} -c "import raven_hydro; print(f'raven_hydro version: {raven_hydro.__version__}')"
- name: Install raven-hydro (conda)
if: ${{ matrix.conda }}
run: |
python -m pip install --editable . ${{ matrix.install_args }}
- name: Check versions
if: ${{ matrix.conda }}
run: |
micromamba list
python -m pip list
python -m pip check || true
- name: Test raven-hydro (conda)
if: ${{ matrix.conda }}
run: |
python -c "import raven_hydro; print(f'Description: {raven_hydro.__doc__}')"
python -c "import raven_hydro; print(f'Built with netcdf: {raven_hydro.__netcdf__}')"
python -c "import raven_hydro; print(f'RavenHydroFramework version: {raven_hydro.__raven_version__}')"
python -c "import raven_hydro; print(f'raven_hydro version: {raven_hydro.__version__}')"
- name: Test raven
run: |
raven -v