Skip to content
Merged
Changes from 1 commit
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
39 changes: 12 additions & 27 deletions setup-poetry/action.yml
Comment thread
bkeryan marked this conversation as resolved.
Comment thread
bkeryan marked this conversation as resolved.
Comment thread
bkeryan marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,18 @@ runs:
exit 1
fi
shell: bash
- name: Set paths (Linux/Mac)
if: runner.os != 'Windows'
- name: Set paths
run: |
# Use the "pipeline directory" so that tools that search the workspace
# directory for Python files will not find the Poetry cache. Use
# realpath to normalize the "../".
PIPELINE_DIR="$(realpath $GITHUB_WORKSPACE/..)"
POETRY_ROOT="$PIPELINE_DIR/.cache/poetry"
echo "POETRY_BIN_DIR=$POETRY_ROOT/bin" >> "$GITHUB_ENV"
echo "POETRY_CONFIG_DIR=$POETRY_ROOT/config" >> "$GITHUB_ENV"
echo "POETRY_HOME=$POETRY_ROOT/home" >> "$GITHUB_ENV"
echo "POETRY_HOME_BIN=$POETRY_ROOT/home/bin" >> "$GITHUB_ENV"
echo "$POETRY_ROOT/bin" >> "$GITHUB_PATH"
shell: bash
- name: Set paths (Windows)
if: runner.os == 'Windows'
run: |
# Use the "pipeline directory" so that tools that search the workspace
# directory for Python files will not find the Poetry cache. Use
# Resolve-Path to normalize the "../".
$PIPELINE_DIR = (Resolve-Path -Path "$env:GITHUB_WORKSPACE\..").Path
$POETRY_ROOT = "$PIPELINE_DIR\.cache\poetry"
Add-Content $env:GITHUB_ENV "POETRY_BIN_DIR=$POETRY_ROOT\bin"
Add-Content $env:GITHUB_ENV "POETRY_CONFIG_DIR=$POETRY_ROOT\config"
Add-Content $env:GITHUB_ENV "POETRY_HOME=$POETRY_ROOT\home"
Add-Content $env:GITHUB_ENV "POETRY_HOME_BIN=$POETRY_ROOT\home\Scripts"
Add-Content $env:GITHUB_PATH "$POETRY_ROOT\bin"
$poetryRoot = Join-Path $env:RUNNER_TEMP "poetry"
$poetryHome = Join-Path $poetryRoot "home"
$poetryBin = Join-Path $poetryRoot "bin"
$binaryFolderName = if ($IsWindows) { "Scripts" } else { "bin" }

Add-Content $env:GITHUB_ENV "POETRY_BIN_DIR=$poetryBin"
Add-Content $env:GITHUB_ENV "POETRY_CONFIG_DIR=$(Join-Path $poetryRoot "config")"
Add-Content $env:GITHUB_ENV "POETRY_HOME=$poetryHome"
Add-Content $env:GITHUB_ENV "POETRY_HOME_BIN=$(Join-Path $poetryHome $binaryFolderName)"
Add-Content $env:GITHUB_PATH $poetryBin
shell: pwsh
Comment thread
szb640 marked this conversation as resolved.
Outdated
Comment thread
szb640 marked this conversation as resolved.
Outdated
- name: Copy paths from $GITHUB_ENV to $GITHUB_OUTPUT
id: copy-paths
Expand Down Expand Up @@ -88,4 +73,4 @@ runs:
echo "RUNNER_TEMP=$RUNNER_TEMP"
echo "RUNNER_TOOL_CACHE=$RUNNER_TOOL_CACHE"
ls -al "$POETRY_BIN_DIR" "$POETRY_HOME" "$POETRY_HOME_BIN" || true
shell: bash
shell: bash
Loading