Skip to content
Open
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
34 changes: 34 additions & 0 deletions .github/actions/setup-conda-lock/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Set up Conda and conda-lock
description: Install the lock tool separately from the Python environments under test
runs:
using: composite
steps:
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v4
with:
activate-environment: ''
auto-activate: false
channels: conda-forge
channel-priority: strict
- name: Install conda-lock
shell: bash
run: |
python3 -m venv "$RUNNER_TEMP/conda-lock-tools"
"$RUNNER_TEMP/conda-lock-tools/bin/python" -m pip install conda-lock==4.0.3
echo "$RUNNER_TEMP/conda-lock-tools/bin" >> "$GITHUB_PATH"
echo "CONDA_ENVS_PATH=$RUNNER_TEMP/zeppelin-python" >> "$GITHUB_ENV"
65 changes: 65 additions & 0 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: Set up locked Python environment
description: Install a Conda and pip environment from its committed or candidate lock
inputs:
environment:
description: Conda environment and lock profile to install
required: true
lock-artifact:
description: Optional same-run artifact containing candidate conda-lock files
required: false
default: ''
runs:
using: composite
steps:
- name: Download candidate Python locks
if: ${{ inputs.lock-artifact != '' }}
uses: actions/download-artifact@v7
with:
name: ${{ inputs.lock-artifact }}
path: ${{ runner.temp }}/python-lock-candidate
- name: Use candidate Python lock
if: ${{ inputs.lock-artifact != '' }}
shell: bash
env:
ENVIRONMENT: ${{ inputs.environment }}
run: cp -- "$RUNNER_TEMP/python-lock-candidate/$ENVIRONMENT.conda-lock.yml" "testing/locks/$ENVIRONMENT.conda-lock.yml"
- name: Set up Conda and conda-lock
uses: ./.github/actions/setup-conda-lock
- name: Restore locked environment
if: ${{ inputs.lock-artifact == '' }}
id: environment-cache
uses: actions/cache/restore@v5
with:
path: ${{ runner.temp }}/zeppelin-python/${{ inputs.environment }}
key: ${{ runner.os }}-${{ runner.arch }}-conda-v1-${{ inputs.environment }}-${{ hashFiles(format('testing/locks/{0}.conda-lock.yml', inputs.environment)) }}
- name: Install locked Python environment
if: ${{ inputs.lock-artifact != '' || steps.environment-cache.outputs.cache-hit != 'true' }}
shell: bash
env:
ENVIRONMENT: ${{ inputs.environment }}
run: conda-lock install --no-mamba --name "$ENVIRONMENT" "testing/locks/$ENVIRONMENT.conda-lock.yml"
- name: Save locked environment
if: ${{ inputs.lock-artifact == '' && steps.environment-cache.outputs.cache-hit != 'true' && github.repository == 'apache/zeppelin' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: actions/cache/save@v5
with:
path: ${{ runner.temp }}/zeppelin-python/${{ inputs.environment }}
key: ${{ steps.environment-cache.outputs.cache-primary-key }}
Loading
Loading