Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ updates:
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
time: '12:00'
groups:
actions:
patterns:
- "*"

- package-ecosystem: pip
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
time: '12:00'
groups:
python:
patterns:
- "*"
10 changes: 10 additions & 0 deletions .github/workflows/first_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ on:
types:
- opened

permissions:
contents: read

jobs:
welcome:
name: Welcome
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: audit
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down
118 changes: 74 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@ jobs:
lint:
name: Linting Suite
runs-on: ubuntu-latest
strategy:
matrix:
tox-env:
- lint
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.10"
cache: pip
- name: Install tox
- name: Install CI libraries
run: |
python -m pip install tox~=4.24.1
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment Caching
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
Expand All @@ -45,33 +52,40 @@ jobs:
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 }}
python -m tox -e lint

pypi:
test-pypi:
name: Python${{ matrix.python-version }} (PyPI + Tox)
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
include:
- python-version: "3.10"
tox-env: py310
- python-version: "3.11"
tox-env: py311
- python-version: "3.12"
tox-env: py312
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
coveralls.io:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
raw.githubusercontent.com:443
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install tox
- name: Install CI libraries
run: |
python -m pip install tox~=4.24.1
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment Caching
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
Expand All @@ -82,34 +96,43 @@ jobs:
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 }}
python -m tox
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-${{ matrix.tox-env }}
COVERALLS_FLAG_NAME: run-Python${{ matrix.python-version }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github

conda:
name: Python${{ matrix.python-version }} (Anaconda, upstream=${{ matrix.upstream }})
test-conda:
name: Python${{ matrix.python-version }} (Anaconda)
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- 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
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
conda.anaconda.org:443
coveralls.io:443
files.pythonhosted.org:443
github.com:443
objects.githubusercontent.com:443
pypi.org:443
raw.githubusercontent.com:443
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
with:
Expand All @@ -118,13 +141,10 @@ jobs:
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
pytest-timeout
- 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
python -m pip install --no-user --no-deps --editable .
- name: Test Data Caching
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
Expand All @@ -136,22 +156,32 @@ jobs:
run: |
micromamba list
python -m pip check || true
pip install pytest-timeout
- name: Test with conda
run: |
python -m pytest -m "not slow" --timeout=180 --durations=10 --cov=clisops --cov-report=term-missing
python -m pytest -m "not slow" --timeout=300 --numprocesses=logical --durations=10 --cov=clisops --cov-report=lcov
- name: Report Coverage
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
flag-name: run-Python${{ matrix.python-version }}-conda
parallel: true

finish:
name: Finish
needs:
- pypi
- conda
- test-pypi
- test-conda
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
coveralls.io:443
github.com:443
objects.githubusercontent.com:443
- name: Coveralls Finished
run: |
python -m pip install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
parallel-finished: true
16 changes: 14 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,33 @@ on:
tags:
- 'v*.*' # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: read

jobs:
release:
name: Create Release from tag
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '.0')
permissions:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Create Release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: true
prerelease: false
14 changes: 12 additions & 2 deletions .github/workflows/publish-pypi-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
types:
- published

permissions:
contents: read

jobs:
build-n-publish-pypi:
name: Build and publish Python 🐍 distributions 📦 to PyPI
Expand All @@ -14,15 +17,22 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Python3.x
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.x"
- name: Install packaging libraries
- name: Install CI libraries
run: |
python -m pip install flit
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Build a binary wheel and a source tarball
run: |
python -m flit build
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/tag-testpypi-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- 'v*.*' # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: read

jobs:
deploy-testpypi:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
Expand All @@ -14,15 +17,22 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Python3.x
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.x"
- name: Install packaging libraries
- name: Install CI libraries
run: |
python -m pip install flit
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Build a binary wheel and a source tarball
run: |
python -m flit build
Expand Down
Loading