Skip to content

Install and test from sdist #8

Install and test from sdist

Install and test from sdist #8

name: Install from sdist on macOS ARM64
on:
workflow_dispatch:
inputs:
url:
description: "URL to the sdist"
required: true
python_version:
description: "Python version to use"
default: "3.12"
required: true
jobs:
test:
runs-on: macos-14
environment: urdrome
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
architecture: "arm64"
- name: Parse URL
id: parse_url
run: |
URL="${{ inputs.url }}"
if [[ "$URL" =~ ^https://github\.com/.+/actions/runs/[0-9]+$ ]]; then
echo "is_gh=true" >> $GITHUB_OUTPUT
REPO=$(echo "$URL" | sed -E 's|https://github\.com/([^/]+/[^/]+)/actions/runs/[0-9]+|\1|')
RUN_ID=$(echo "$URL" | sed -E 's|.*/runs/([0-9]+)|\1|')
echo "repo=$REPO" >> $GITHUB_OUTPUT
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
fi
- name: Download sdist with gh
if: steps.parse_url.outputs.is_gh == 'true'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
repo=${{steps.parse_url.outputs.repo}}
run_id=${{steps.parse_url.outputs.run_id}}
gh run download --repo $repo -n perspective-python-sdist $run_id
- name: Download sdist with curl
if: steps.parse_url.outputs.is_gh == 'false'
run: |
curl --fail -LO "${{ inputs.url }}"
- name: Install sdist
run: |
if [[ -f "perspective_python-3.1.2.tar.gz" ]]; then
echo "setting PSP_ARCH for broken perspective-server 3.1.2"
export PSP_ARCH=aarch64
fi
python -m pip install --no-clean -v ./perspective_python-*.tar.gz