Skip to content

Commit

Permalink
Merge pull request #891 from altheaden/update-ci
Browse files Browse the repository at this point in the history
CI updates and cleanup
  • Loading branch information
xylar authored Feb 4, 2025
2 parents b3deddd + 5835fd4 commit 88d25f7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
env:
CANCEL_OTHERS: false
PATHS_IGNORE: '["**/README.md", "**/docs/**"]'
PYTHON_VERSION: "3.13"

jobs:
pre-commit-hooks:
Expand All @@ -30,15 +31,17 @@ jobs:
uses: actions/checkout@v4

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Set up Python 3.10
name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ env.PYTHON_VERSION }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
id: file_changes
uses: trilom/file-changes-action@v1.2.4
uses: trilom/file-changes-action@1.2.4
with:
output: ' '

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
Expand Down Expand Up @@ -69,18 +72,6 @@ jobs:
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: actions/checkout@v4

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Cache Conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if conda-dev-spec.template has not changed in the workflow
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir_py${{ matrix.python-version }}
key:
${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda/configure_compass_env.py,conda/*,conda/compass_env/*') }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -90,7 +81,7 @@ jobs:
channels: conda-forge,e3sm/label/compass
channel-priority: strict
use-mamba: false
auto-update-conda: false
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/docs_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
release:
types: [published]

env:
PYTHON_VERSION: "3.13"

jobs:
publish-docs:
runs-on: ubuntu-latest
Expand All @@ -22,16 +25,6 @@ jobs:
persist-credentials: false
fetch-depth: 0

- name: Cache Conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if deploy/conda-dev-spec.template has not changed in the workflow
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda/configure_compass_env.py,conda/*,conda/compass_env/*') }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -41,8 +34,8 @@ jobs:
channels: conda-forge,e3sm/label/compass
channel-priority: strict
use-mamba: false
auto-update-conda: false
python-version: ${{ matrix.python-version }}
auto-update-conda: true
python-version: ${{ env.PYTHON_VERSION }}

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Install compass
Expand All @@ -51,7 +44,7 @@ jobs:
./conda/configure_compass_env.py \
--env_only \
--env_name compass_test \
--python=${{ matrix.python-version }} \
--python=${{ env.PYTHON_VERSION }} \
--verbose
source load_compass_test.sh
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pre_commit_update_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

env:
UP_TO_DATE: false
PYTHON_VERSION: "3.13"

jobs:
auto-update:
Expand All @@ -22,7 +23,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ env.PYTHON_VERSION }}

- name: Install pre-commit
run: pip install pre-commit
Expand Down

0 comments on commit 88d25f7

Please sign in to comment.