Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
- uses: pyiron/actions/update-env-files@v3.3.2
- uses: pyiron/actions/update-env-files@use_miniconda
- name: UpdateDependabotPR commit
run: |
git config --local user.email "pyiron@mpie.de"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:

tests-and-coverage:
if: contains(github.event.pull_request.labels.*.name, 'run_coverage')
uses: pyiron/actions/.github/workflows/tests-and-coverage.yml@v3.3.2
uses: pyiron/actions/.github/workflows/tests-and-coverage.yml@use_miniconda
secrets: inherit

code-ql:
if: contains(github.event.pull_request.labels.*.name, 'run_CodeQL')
uses: pyiron/actions/.github/workflows/codeql.yml@v3.3.2
uses: pyiron/actions/.github/workflows/codeql.yml@use_miniconda
secrets: inherit
22 changes: 11 additions & 11 deletions .github/workflows/push-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
if: ${{ inputs.do-commit-updated-env }}
- uses: pyiron/actions/write-docs-env@v3.3.2
- uses: pyiron/actions/write-docs-env@use_miniconda
with:
env-files: ${{ inputs.docs-env-files }}
if: ${{ inputs.do-commit-updated-env }}
- uses: pyiron/actions/write-environment@v3.3.2
- uses: pyiron/actions/write-environment@use_miniconda
with:
env-files: ${{ inputs.notebooks-env-files }}
output-env-file: .binder/environment.yml
Expand All @@ -228,7 +228,7 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/build-docs@v3.3.2
- uses: pyiron/actions/build-docs@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.docs-env-files }}
Expand All @@ -239,7 +239,7 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/build-notebooks@v3.3.2
- uses: pyiron/actions/build-notebooks@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.notebooks-env-files }}
Expand Down Expand Up @@ -276,11 +276,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/add-to-python-path@v3.3.2
- uses: pyiron/actions/add-to-python-path@use_miniconda
if: inputs.extra-python-paths != ''
with:
path-dirs: ${{ inputs.extra-python-paths }}
- uses: pyiron/actions/unit-tests@v3.3.2
- uses: pyiron/actions/unit-tests@use_miniconda
with:
python-version: ${{ matrix.python-version }}
env-files: ${{ inputs.tests-env-files }}
Expand All @@ -291,7 +291,7 @@ jobs:
coveralls-and-codacy:
needs: commit-updated-env
if: ${{ inputs.do-coveralls || inputs.do-codacy }}
uses: pyiron/actions/.github/workflows/tests-and-coverage.yml@v3.3.2
uses: pyiron/actions/.github/workflows/tests-and-coverage.yml@use_miniconda
secrets: inherit
with:
tests-env-files: ${{ inputs.tests-env-files }}
Expand All @@ -310,7 +310,7 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/unit-tests@v3.3.2
- uses: pyiron/actions/unit-tests@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.tests-env-files }}
Expand All @@ -323,11 +323,11 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/add-to-python-path@v3.3.2
- uses: pyiron/actions/add-to-python-path@use_miniconda
if: inputs.extra-python-paths != ''
with:
path-dirs: ${{ inputs.extra-python-paths }}
- uses: pyiron/actions/unit-tests@v3.3.2
- uses: pyiron/actions/unit-tests@use_miniconda
with:
python-version: ${{ inputs.alternate-tests-python-version }}
env-files: ${{ inputs.alternate-tests-env-files }}
Expand All @@ -341,7 +341,7 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/pip-check@v3.3.2
- uses: pyiron/actions/pip-check@use_miniconda
with:
python-version: ${{ inputs.python-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pyproject-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
inputs:
python-version:
type: string
description: 'Cached mamba python versions'
description: 'Cached python versions'
default: '3.12'
required: false
env-files:
Expand Down Expand Up @@ -83,11 +83,11 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/cached-miniforge@v3.3.2
- uses: pyiron/actions/cached-miniforge@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.env-files }}
- uses: pyiron/actions/update-pyproject-dependencies@v3.3.2
- uses: pyiron/actions/update-pyproject-dependencies@use_miniconda
with:
input-toml: ${{ inputs.input-toml }}
lower-bound-yaml: ${{ inputs.lower-bound-yaml }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- uses: pyiron/actions/add-to-python-path@v3.3.2
- uses: pyiron/actions/add-to-python-path@use_miniconda
if: inputs.extra-python-paths != ''
with:
path-dirs: ${{ inputs.extra-python-paths }}
- uses: pyiron/actions/unit-tests@v3.3.2
- uses: pyiron/actions/unit-tests@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.tests-env-files }}
Expand Down
10 changes: 8 additions & 2 deletions .support/update_actions_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
# Set default value for $1 if not provided
PATTERN=${1:-$(git rev-parse --abbrev-ref HEAD)}

# Recursive search and replace
find . -type f \( -name "*.yml" -o -name "*.md" \) -exec sed -i 's/\(pyiron\/actions\/[^@]*\)@[^*]*/\1@'"$PATTERN"'/g' {} +
# Check if we're on macOS or Linux and use appropriate sed syntax
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS version
find . -type f \( -name "*.yml" -o -name "*.md" \) -exec sed -i '' 's/\(pyiron\/actions\/[^@]*\)@[^*]*/\1@'"$PATTERN"'/g' {} +
else
# Linux version (and others)
find . -type f \( -name "*.yml" -o -name "*.md" \) -exec sed -i 's/\(pyiron\/actions\/[^@]*\)@[^*]*/\1@'"$PATTERN"'/g' {} +
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ on:

jobs:
pyiron:
uses: pyiron/actions/.github/workflows/push-pull.yml@v3.3.2
uses: pyiron/actions/.github/workflows/push-pull.yml@use_miniconda
secrets: inherit
```

Expand Down
4 changes: 2 additions & 2 deletions build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ inputs:
runs:
using: 'composite'
steps:
- uses: pyiron/actions/cached-miniforge@v3.3.2
- uses: pyiron/actions/cached-miniforge@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.standard-docs-env-file }} ${{ inputs.env-files }}
- uses: pyiron/actions/pyiron-config@v3.3.2
- uses: pyiron/actions/pyiron-config@use_miniconda
- name: Build sphinx documentation
shell: bash -l {0}
run: |
Expand Down
4 changes: 2 additions & 2 deletions build-notebooks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ inputs:
runs:
using: 'composite'
steps:
- uses: pyiron/actions/cached-miniforge@v3.3.2
- uses: pyiron/actions/cached-miniforge@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.standard-notebooks-env-file }} ${{ inputs.env-files }}
- uses: pyiron/actions/pyiron-config@v3.3.2
- uses: pyiron/actions/pyiron-config@use_miniconda
- name: Build notebooks
shell: bash -l {0}
run: $GITHUB_ACTION_PATH/../.support/build_notebooks.sh ${{ inputs.notebooks-dir }} ${{ inputs.exclusion-file }} ${{ inputs.kernel }}
63 changes: 13 additions & 50 deletions cached-miniforge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inputs:
required: false
env-path:
description: 'A full path to the environment, used for miniconda activate-environment and cache path'
default: 'cached-miniforge/my-env'
default: './cached-miniforge/my-env'
required: false
local-code-directory:
description: 'The location containing the code under development; targeted by pip install. If an empty string, local code will not be pip-installed at all!'
Expand All @@ -36,24 +36,15 @@ inputs:
miniforge-channels:
description: 'conda-incubator/setup-miniconda argument'
default: conda-forge
# default: conda-forge,nodefaults # TODO: Use nodefaults directly once setup-miniconda is fixed
required: false
miniforge-channel-priority:
description: 'conda-incubator/setup-miniconda argument'
default: strict
required: false
miniforge-use-mamba:
miniforge-conda-remove-defaults:
description: 'conda-incubator/setup-miniconda argument'
default: 'true'
required: false
miniforge-condarc-file:
description: 'conda-incubator/setup-miniconda argument, BUT we change the default to resolve https://github.com/conda-incubator/setup-miniconda/issues/207'
default: '.condarc'
required: false
miniforge-activate-environment:
description: 'DEPRECATED. Use env-path and include a path instead. If provided, will be used as the new env-path with cached-miniforge/ prepended as the path.'
default: ''
required: false
pip-install-versioneer:
description: 'Pip-install versioneer[toml]'
default: 'true'
Expand All @@ -71,28 +62,17 @@ inputs:
runs:
using: "composite"
steps:
- uses: pyiron/actions/write-environment@v3.3.2
- uses: pyiron/actions/write-environment@use_miniconda
with:
env-files: ${{ inputs.env-files }}
- name: Env name backwards compatibility patch
# Can be replaced with direct usage of `inputs.env-path` after a major version bump
id: env-path-backwards-compatibility
shell: bash -l {0}
run: |
if [ -z "${{ inputs.miniforge-activate-environment }}" ]; then
env_path=${{ inputs.env-path }}
else
env_path=cached-miniforge/${{ inputs.miniforge-activate-environment }}
fi
echo env-path=${env_path} >> $GITHUB_OUTPUT
- name: Calculate cache label info
if: inputs.use-cache == 'true'
id: cache-info
shell: bash -l {0}
run: |
pyversion_string=${{ inputs.python-version }}
pyversion_string=${pyversion_string/\./-}
env_string=${{ steps.env-path-backwards-compatibility.outputs.env-path }}
env_string=${{ inputs.env-path }}
env_string=${env_string//\//-}
LABEL=${{ runner.os }}-${{ runner.arch }}-py-${pyversion_string}-${env_string}
HASH=${{ hashFiles(env.WRITE_ENVIRONMENT_OUTPUT_ENV_FILE) }}
Expand All @@ -103,40 +83,24 @@ runs:
uses: actions/cache/restore@v4
id: look-for-cache
with:
path: ${{ steps.env-path-backwards-compatibility.outputs.env-path }}
path: ${{ inputs.env-path }}
key: ${{ steps.cache-info.outputs.CASH_KEY }}
lookup-only: true
- name: Prepopulate condarc
# To resolve: https://github.com/conda-incubator/setup-miniconda/issues/207
# Because conda behaves like this: https://github.com/conda/conda/issues/12356
# And now using `default` can cost money: https://www.anaconda.com/blog/is-conda-free
# Only necessary until conda-incubator/setup-miniconda is fixed: https://github.com/conda-incubator/setup-miniconda/pull/364
shell: bash -l {0}
run: |
echo "channels:" > "${{ inputs.miniforge-condarc-file }}"
IFS=',' read -ra CHANNELS <<< "${{ inputs.miniforge-channels }}"
for channel in "${CHANNELS[@]}"; do
channel=$(echo "$channel" | xargs)
echo "- $channel" >> "${{ inputs.miniforge-condarc-file }}"
done
echo "Prepopulated condarc file ${{ inputs.miniforge-condarc-file }}:"
cat ${{ inputs.miniforge-condarc-file }}
- name: Install using cached env
if: inputs.use-cache == 'true' && steps.look-for-cache.outputs.cache-hit == 'true'
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: ${{ inputs.miniforge-variant }}
miniforge-version: ${{ inputs.miniforge-version }}
# channels: ${{ inputs.miniforge-channels }}
condarc-file: ${{ inputs.miniforge-condarc-file }} # TODO: Use channels once setup-miniconda is fixed
channels: ${{ inputs.miniforge-channels }}
conda-remove-defaults: $${ miniforge-conda-remove-defaults }}
channel-priority: ${{ inputs.miniforge-channel-priority }}
activate-environment: ${{ steps.env-path-backwards-compatibility.outputs.env-path }}
use-mamba: ${{ inputs.miniforge-use-mamba }}
activate-environment: ${{ inputs.env-path }}
- name: Load cached environment
if: inputs.use-cache == 'true' && steps.look-for-cache.outputs.cache-hit == 'true'
uses: actions/cache/restore@v4
with:
path: ${{ steps.env-path-backwards-compatibility.outputs.env-path }}
path: ${{ inputs.env-path }}
key: ${{ steps.cache-info.outputs.CASH_KEY }}
- name: Build environment from file
if: inputs.use-cache != 'true' || steps.look-for-cache.outputs.cache-hit != 'true'
Expand All @@ -145,18 +109,17 @@ runs:
python-version: ${{ inputs.python-version }}
miniforge-variant: ${{ inputs.miniforge-variant }}
miniforge-version: ${{ inputs.miniforge-version }}
# channels: ${{ inputs.miniforge-channels }}
condarc-file: ${{ inputs.miniforge-condarc-file }} # TODO: Use channels once setup-miniconda is fixed
channels: ${{ inputs.miniforge-channels }}
conda-remove-defaults: $${ inputs.miniforge-conda-remove-defaults }}
channel-priority: ${{ inputs.miniforge-channel-priority }}
activate-environment: ${{ steps.env-path-backwards-compatibility.outputs.env-path }}
use-mamba: ${{ inputs.miniforge-use-mamba }}
activate-environment: ${{ inputs.env-path }}
environment-file: ${{ env.WRITE_ENVIRONMENT_OUTPUT_ENV_FILE }}
- name: Cache new env
if: inputs.use-cache == 'true' && steps.look-for-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
id: cache-env
with:
path: ${{ steps.env-path-backwards-compatibility.outputs.env-path }}
path: ${{ inputs.env-path }}
key: ${{ steps.cache-info.outputs.CASH_KEY }}
- name: Display env info
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion pip-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: pyiron/actions/cached-miniforge@v3.3.2
- uses: pyiron/actions/cached-miniforge@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.env-files }}
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ inputs:
runs:
using: 'composite'
steps:
- uses: pyiron/actions/cached-miniforge@v3.3.2
- uses: pyiron/actions/cached-miniforge@use_miniconda
with:
python-version: ${{ inputs.python-version }}
env-files: ${{ inputs.standard-unittests-env-file }} ${{ inputs.coveralls-codacy-env-file }} ${{ inputs.env-files }}
- uses: pyiron/actions/pyiron-config@v3.3.2
- uses: pyiron/actions/pyiron-config@use_miniconda
- name: Test
shell: bash -l {0}
run: |
Expand Down