Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment init #5

Merged
merged 4 commits into from
May 28, 2024
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
48 changes: 35 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,48 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.10'

- name: Install Poetry
run: |
pip install poetry

- name: Configure Poetry
run: |
poetry config virtualenvs.create false
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: climateset
use-mamba: true

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER
}}
env:
CACHE_NUMBER: 0
id: cache

- name: Update environment
run:
mamba env update -n climateset -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install dependencies
run: |
make install
make CONDA_TOOL=mamba install

- name: Run linting checks
run: |
make check-pylint
make check-pylint
48 changes: 35 additions & 13 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,48 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.10'

- name: Install Poetry
run: |
pip install poetry

- name: Configure Poetry
run: |
poetry config virtualenvs.create false
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: climateset
use-mamba: true

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER
}}
env:
CACHE_NUMBER: 0
id: cache

- name: Update environment
run:
mamba env update -n climateset -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install dependencies
run: |
make install
make CONDA_TOOL=mamba install

- name: Run Pre-commit checks
run: |
make precommit
make precommit
2 changes: 1 addition & 1 deletion Makefile.variables
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

APPLICATION_NAME := climateset
CONDA_ENVIRONMENT := climateset
PYTHON_VERSION := 3.10
PYTHON_VERSION := 3.11
5 changes: 3 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ name: climateset
channels:
- conda-forge
dependencies:
- python=3.10

- python=3.11
- cdo
- nco
Loading
Loading