Skip to content

Bump step-security/harden-runner from 2.9.1 to 2.10.1 #936

Bump step-security/harden-runner from 2.9.1 to 2.10.1

Bump step-security/harden-runner from 2.9.1 to 2.10.1 #936

Workflow file for this run

name: CLISOPS Testing Suite
on:
push:
branches:
- master
pull_request:
concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on master.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
ESGF_TEST_DATA_VERSION: v1
permissions:
contents: read
jobs:
lint:
name: Linting Suite
runs-on: ubuntu-latest
strategy:
matrix:
tox-env:
- lint
steps:
- name: Checkout Repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.9"
cache: pip
- name: Install tox
run: |
python -m pip install tox~=4.18.0
- name: Environment Caching
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: |
.tox
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-lint-${{ env.ESGF_TEST_DATA_VERSION }}
- name: Run linting suite
run: |
python -m tox -e ${{ matrix.tox-env }}
pypi:
name: Python${{ matrix.python-version }} (PyPI + Tox)
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
include:
- python-version: "3.9"
tox-env: py39
- python-version: "3.10"
tox-env: py310
- python-version: "3.11"
tox-env: py311
- python-version: "3.12"
tox-env: py312
steps:
- name: Checkout Repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install tox
run: |
python -m pip install tox~=4.18.0
- name: Environment Caching
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: |
~/.cache/mini-esgf-data
~/.cache/xclim-testdata
.tox
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-Python${{ matrix.python-version }}-${{ env.ESGF_TEST_DATA_VERSION }}
- name: Test with tox
run: |
python -m tox -e ${{ matrix.tox-env }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-${{ matrix.tox-env }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
conda:
name: Python${{ matrix.python-version }} (Anaconda, upstream=${{ matrix.upstream }})
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.9"
upstream: false
- python-version: "3.10"
upstream: false
- python-version: "3.11"
upstream: false
# - python-version: "3.12" # Not yet available until https://github.com/pydata/xarray/issues/7794 is resolved
# upstream: false
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
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 CLISOPS
run: |
python -m pip install --no-user --editable ".[dev]"
- name: Install upstream dependencies
if: ${{ matrix.upstream }}
run: |
python -m pip install -r requirements_upstream.txt
- name: Test Data Caching
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: |
~/.cache/mini-esgf-data
~/.cache/xclim-testdata
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-conda-Python${{ matrix.python-version }}-${{ env.ESGF_TEST_DATA_VERSION }}
- name: Check versions
run: |
micromamba list
python -m pip check || true
- name: Test with conda
run: |
python -m pytest --numprocesses=logical --durations=10 --cov=clisops --cov-report=term-missing
finish:
needs:
- pypi
- conda
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Coveralls Finished
run: |
python -m pip install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github