Skip to content

Commit

Permalink
Merge branch 'master' into adapt_freq_in_training
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre authored Sep 5, 2023
2 parents ad43e39 + 5c32fac commit 22f4eb8
Show file tree
Hide file tree
Showing 40 changed files with 881 additions and 306 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/actions-versions-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
with:
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Run GitHub Actions Version Updater
Expand All @@ -21,4 +21,4 @@ jobs:
committer_email: 'bumpversion[bot]@ouranos.ca'
committer_username: 'update-github-actions[bot]'
pull_request_title: '[bot] Update GitHub Action Versions'
pull_request_user_reviewers: "Zeitsperre"
pull_request_team_reviewers: "xclim-core"
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
name: Bumpversion Patch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
with:
persist-credentials: false
- uses: actions/setup-python@v4
- uses: actions/setup-python@v4.7.0
with:
python-version: "3.x"
- name: Config Commit Bot
Expand All @@ -50,7 +50,7 @@ jobs:
NEW_VERSION="$(grep -E '__version__' xclim/__init__.py | cut -d ' ' -f3)"
echo "new_version=${NEW_VERSION}"
- name: Push Changes
uses: ad-m/github-push-action@master
uses: ad-m/github-push-action@v0.6.0
with:
force: false
github_token: ${{ secrets.BUMPVERSION_TOKEN }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/cache-cleaner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Example taken from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#managing-caches
name: Cleanup Caches on PR Merge
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/[email protected]

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
- 'python'
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v3.6.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@codeql-bundle-20230524
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@codeql-bundle-20230524
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@codeql-bundle-20230524
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v3.6.0
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v3.0.8
2 changes: 1 addition & 1 deletion .github/workflows/first_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Welcome
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v6.4.1
with:
script: |
// Get a list of all issues created by the PR opener
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v4.3.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/label_on_approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v6.4.1
with:
script: |
github.rest.issues.addLabels({
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Install pylint and tox
Expand All @@ -63,9 +63,9 @@ jobs:
- tox-env: "py39"
python-version: "3.9"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down Expand Up @@ -95,14 +95,14 @@ jobs:
- tox-env: py311-coverage-sbck
python-version: "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Install Eigen3
if: contains(matrix.tox-env, 'sbck')
run: |
sudo apt-get update
sudo apt-get install libeigen3-dev
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down Expand Up @@ -132,9 +132,9 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v1.4.3
with:
cache-downloads: true
cache-environment: true
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish-mastodon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Release Announcement to Mastodon

on:
status:
types:
- published
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/[email protected]

- name: Current Version
run: |
CURRENT_VERSION="$(grep -E '__version__' xclim/__init__.py | cut -d ' ' -f3)"
echo "current_version=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Send toot to Mastodon
id: mastodon
uses: cbrgm/[email protected]
with:
message: |
New #xclim release: v${{ env.current_version }} 🎉
Source code available at: https://github.com/Ouranosinc/xclim
Check out the docs for more information: https://xclim.readthedocs.io/en/v${{ env.current_version }}/
visibility: "public" # default: public
env:
MASTODON_URL: ${{ secrets.MASTODON_URL }} # https://example.social
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} # access token
6 changes: 3 additions & 3 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Set up Python3
uses: actions/setup-python@v4
uses: actions/setup-python@v4.7.0
with:
python-version: "3.x"
- name: Install packaging libraries
run: pip install flit
- name: Build a binary wheel and a source tarball
run: flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Set up Python3
uses: actions/setup-python@v4
uses: actions/setup-python@v4.7.0
with:
python-version: "3.x"
- name: Install packaging libraries
run: pip install flit
- name: Build a binary wheel and a source tarball
run: flit build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/testdata_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Check Latest xclim-testdata Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Find xclim-testdata Tag and CI Testing Branch
run: |
XCLIM_TESTDATA_TAG="$( \
Expand All @@ -30,41 +30,45 @@ jobs:
echo "Latest xclim-testdata tag: ${{ env.XCLIM_TESTDATA_TAG }}"
echo "Tag for xclim-testdata in CI: ${{ env.XCLIM_TESTDATA_BRANCH }}"
- name: Find Comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v2.4.0
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: It appears that this PR modifies the `XCLIM_TESTDATA_BRANCH` environment variable
body-includes: It appears that this Pull Request modifies the `main.yml` workflow.
- name: Compare Versions
if: ${{( env.XCLIM_TESTDATA_TAG != env.XCLIM_TESTDATA_BRANCH )}}
uses: actions/github-script@v6
uses: actions/github-script@v6.4.1
with:
script: |
core.setFailed('Configured `xclim-testdata` tag is not `latest`.')
- name: Update Failure Comment
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3.0.2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
> **Warning**
> It appears that this PR modifies the `XCLIM_TESTDATA_BRANCH` environment variable to a tag that is not the latest in the `Ouranosinc/xclim-testdata` repository.
> It appears that this Pull Request modifies the `main.yml` workflow.
Please be sure to modify this value to match the most recent tag (`${{ env.XCLIM_TESTDATA_TAG }}`) before merging.
On inspection, it seems that the `XCLIM_TESTDATA_BRANCH` environment variable is set to a tag that is not the latest in the `Ouranosinc/xclim-testdata` repository.
If this PR depends on changes in a new testing dataset branch, be sure to tag a new version of `Ouranosinc/xclim-testdata` with your changes merged to `main`.
This value must match the most recent tag (`${{ env.XCLIM_TESTDATA_TAG }}`) in order to merge this Pull Request.
If this PR depends on changes in a new testing dataset branch, be sure to tag a new version of `Ouranosinc/xclim-testdata` once your changes have been merged to its `main` branch.
edit-mode: replace
- name: Update Success Comment
if: ${{ success() }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3.0.2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
> **Note**
> It appears that this PR modifies the `XCLIM_TESTDATA_BRANCH` environment variable to the most recent tag (`${{ env.XCLIM_TESTDATA_TAG }}`).
> It appears that this Pull Request modifies the `main.yml` workflow.
On inspection, the `XCLIM_TESTDATA_BRANCH` environment variable is set to the most recent tag (`${{ env.XCLIM_TESTDATA_TAG }}`).
No further action is required.
edit-mode: replace
6 changes: 3 additions & 3 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v1.4.3
with:
cache-downloads: true
cache-environment: true
Expand Down Expand Up @@ -76,6 +76,6 @@ jobs:
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository_owner == 'Ouranosinc'
uses: xarray-contrib/issue-from-pytest-log@v1
uses: xarray-contrib/issue-from-pytest-log@v1.2.6
with:
log-path: output-${{ matrix.python-version }}-log.jsonl
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ repos:
exclude: '(xclim/indices/__init__.py|docs/installation.rst)'
additional_dependencies: ['black==23.7.0']
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.3
rev: 0.26.3
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down
Loading

0 comments on commit 22f4eb8

Please sign in to comment.