From 8b001a4373c265be0a4ea5c7c2b8b8f6e0ee5bb6 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 28 Nov 2024 08:00:34 +0400 Subject: [PATCH] Create action.yml (#86) --- actions/setup-environment-uv/action.yml | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 actions/setup-environment-uv/action.yml diff --git a/actions/setup-environment-uv/action.yml b/actions/setup-environment-uv/action.yml new file mode 100644 index 0000000..532bfc0 --- /dev/null +++ b/actions/setup-environment-uv/action.yml @@ -0,0 +1,44 @@ +# Copyright 2023 Stanford University Convex Optimization Group +# +# Licensed 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: Setup the Python Environment + +description: "Construct a Python environment for ci/cd using uv" + +on: + workflow_call: + inputs: + python-version: + description: 'Python version' + type: string + required: false + default: '3.12' + +runs: + using: "composite" + steps: + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + # Install a specific version of uv. + version: "0.5.4" + + - name: Set up Python ${{ inputs.python-version || '3.12' }} + shell: bash + run: | + uv python install ${{ inputs.python-version || '3.12' }} + + - name: Install the project + shell: bash + run: | + uv sync --all-extras --dev