-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from climate-resource/run-drop-out-half-degree
Run: drop out half degree resolution
- Loading branch information
Showing
101 changed files
with
39,182 additions
and
7,277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,20 @@ | ||
name: "Setup Python and Poetry" | ||
description: "setup Python and Poetry with caches" | ||
name: "Setup Python and pixi" | ||
description: "setup Python and pixi with caches" | ||
|
||
inputs: | ||
python-version: | ||
description: "Python version to use" | ||
pixi-environments: | ||
description: "Pixi environment(s) to install (use a space to separate multiple environments)" | ||
required: true | ||
venv-id: | ||
description: "ID to identify cached environment (should be unique from other steps)" | ||
required: true | ||
poetry-dependency-install-flags: | ||
description: "Flags to pass to poetry when running `poetry install --no-interaction --no-root`" | ||
required: true | ||
run-poetry-install: | ||
description: "Should we run the poetry install steps" | ||
required: false | ||
default: true | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Python ${{ inputs.python-version }} | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- name: Load cached Poetry installation | ||
id: cached-poetry | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.local # the path depends on the OS | ||
key: poetry-2 # increment to reset cache | ||
- name: Install Poetry | ||
if: steps.cached-poetry.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
- name: Load cached venv | ||
if: ${{ inputs.run-poetry-install == 'true' }} | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
- name: Install pixi # also includes auto-caching | ||
uses: prefix-dev/[email protected] | ||
with: | ||
path: .venv | ||
key: "venv-${{ inputs.venv-id }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}" | ||
# Install dependencies first so that our package doesn't appear in the cache by accident | ||
- name: Install dependencies | ||
if: ${{ inputs.run-poetry-install == 'true' }} | ||
shell: bash | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
poetry env use ${{ inputs.python-version }} | ||
poetry install --no-interaction --no-root ${{ inputs.poetry-dependency-install-flags }} | ||
# Now run same command but let the package install too | ||
- name: Install package | ||
if: ${{ inputs.run-poetry-install == 'true' }} | ||
shell: bash | ||
run: poetry install --no-interaction ${{ inputs.poetry-dependency-install-flags }} | ||
cache: true | ||
environments: ${{ inputs.pixi-environments }} | ||
# Enforce consistency between the lock file and pyproject.toml | ||
# because this is an application. | ||
locked: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.