diff --git a/.github/workflows/dependabot-pr.yml b/.github/workflows/dependabot-pr.yml index bae6443..9cead0b 100644 --- a/.github/workflows/dependabot-pr.yml +++ b/.github/workflows/dependabot-pr.yml @@ -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@actions-4.0.0 - name: UpdateDependabotPR commit run: | git config --local user.email "pyiron@mpie.de" diff --git a/.github/workflows/pr-labeled.yml b/.github/workflows/pr-labeled.yml index 27c0cdf..aa7d8c7 100644 --- a/.github/workflows/pr-labeled.yml +++ b/.github/workflows/pr-labeled.yml @@ -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@actions-4.0.0 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@actions-4.0.0 secrets: inherit diff --git a/.github/workflows/push-pull.yml b/.github/workflows/push-pull.yml index 4902b99..97140e4 100644 --- a/.github/workflows/push-pull.yml +++ b/.github/workflows/push-pull.yml @@ -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@actions-4.0.0 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@actions-4.0.0 with: env-files: ${{ inputs.notebooks-env-files }} output-env-file: .binder/environment.yml @@ -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@actions-4.0.0 with: python-version: ${{ inputs.python-version }} env-files: ${{ inputs.docs-env-files }} @@ -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@actions-4.0.0 with: python-version: ${{ inputs.python-version }} env-files: ${{ inputs.notebooks-env-files }} @@ -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@actions-4.0.0 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@actions-4.0.0 with: python-version: ${{ matrix.python-version }} env-files: ${{ inputs.tests-env-files }} @@ -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@actions-4.0.0 secrets: inherit with: tests-env-files: ${{ inputs.tests-env-files }} @@ -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@actions-4.0.0 with: python-version: ${{ inputs.python-version }} env-files: ${{ inputs.tests-env-files }} @@ -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@actions-4.0.0 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@actions-4.0.0 with: python-version: ${{ inputs.alternate-tests-python-version }} env-files: ${{ inputs.alternate-tests-env-files }} @@ -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@actions-4.0.0 with: python-version: ${{ inputs.python-version }} diff --git a/.github/workflows/pyproject-release.yml b/.github/workflows/pyproject-release.yml index 25a1db3..279d3a2 100644 --- a/.github/workflows/pyproject-release.yml +++ b/.github/workflows/pyproject-release.yml @@ -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: @@ -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@actions-4.0.0 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@actions-4.0.0 with: input-toml: ${{ inputs.input-toml }} lower-bound-yaml: ${{ inputs.lower-bound-yaml }} diff --git a/.github/workflows/tests-and-coverage.yml b/.github/workflows/tests-and-coverage.yml index b21f77d..3eca009 100644 --- a/.github/workflows/tests-and-coverage.yml +++ b/.github/workflows/tests-and-coverage.yml @@ -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@actions-4.0.0 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@actions-4.0.0 with: python-version: ${{ inputs.python-version }} env-files: ${{ inputs.tests-env-files }} diff --git a/.support/update_actions_tag.sh b/.support/update_actions_tag.sh index 445ce00..d925346 100755 --- a/.support/update_actions_tag.sh +++ b/.support/update_actions_tag.sh @@ -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' {} + \ No newline at end of file +# 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 \ No newline at end of file diff --git a/README.md b/README.md index a7fda2a..af382de 100644 --- a/README.md +++ b/README.md @@ -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@actions-4.0.0 secrets: inherit ``` diff --git a/build-docs/action.yml b/build-docs/action.yml index bd859f6..0c17584 100644 --- a/build-docs/action.yml +++ b/build-docs/action.yml @@ -21,11 +21,11 @@ inputs: runs: using: 'composite' steps: - - uses: pyiron/actions/cached-miniforge@v3.3.2 + - uses: pyiron/actions/cached-miniforge@actions-4.0.0 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@actions-4.0.0 - name: Build sphinx documentation shell: bash -l {0} run: | diff --git a/build-notebooks/action.yml b/build-notebooks/action.yml index 41fcdbb..558db21 100644 --- a/build-notebooks/action.yml +++ b/build-notebooks/action.yml @@ -28,11 +28,11 @@ inputs: runs: using: 'composite' steps: - - uses: pyiron/actions/cached-miniforge@v3.3.2 + - uses: pyiron/actions/cached-miniforge@actions-4.0.0 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@actions-4.0.0 - name: Build notebooks shell: bash -l {0} run: $GITHUB_ACTION_PATH/../.support/build_notebooks.sh ${{ inputs.notebooks-dir }} ${{ inputs.exclusion-file }} ${{ inputs.kernel }} diff --git a/cached-miniforge/action.yml b/cached-miniforge/action.yml index c003b37..dc9ac7c 100644 --- a/cached-miniforge/action.yml +++ b/cached-miniforge/action.yml @@ -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!' @@ -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' @@ -71,20 +62,9 @@ inputs: runs: using: "composite" steps: - - uses: pyiron/actions/write-environment@v3.3.2 + - uses: pyiron/actions/write-environment@actions-4.0.0 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 @@ -92,7 +72,7 @@ runs: 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) }} @@ -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' @@ -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} diff --git a/pip-check/action.yml b/pip-check/action.yml index d2e5e08..66e019e 100644 --- a/pip-check/action.yml +++ b/pip-check/action.yml @@ -13,7 +13,7 @@ inputs: runs: using: 'composite' steps: - - uses: pyiron/actions/cached-miniforge@v3.3.2 + - uses: pyiron/actions/cached-miniforge@actions-4.0.0 with: python-version: ${{ inputs.python-version }} env-files: ${{ inputs.env-files }} diff --git a/unit-tests/action.yml b/unit-tests/action.yml index 4358fbb..a7cc4a4 100644 --- a/unit-tests/action.yml +++ b/unit-tests/action.yml @@ -35,11 +35,11 @@ inputs: runs: using: 'composite' steps: - - uses: pyiron/actions/cached-miniforge@v3.3.2 + - uses: pyiron/actions/cached-miniforge@actions-4.0.0 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@actions-4.0.0 - name: Test shell: bash -l {0} run: |