2021-11-15 01:54:00 -05:00
|
|
|
name: Test install-poetry.py
|
2021-11-10 10:23:17 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'install-poetry.py'
|
|
|
|
- '.github/workflows/installer.yml'
|
|
|
|
branches:
|
2021-11-12 20:28:30 -05:00
|
|
|
- main
|
2021-11-10 10:23:17 -05:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'install-poetry.py'
|
|
|
|
- '.github/workflows/installer.yml'
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
|
2021-11-15 01:54:00 -05:00
|
|
|
concurrency:
|
2022-09-17 21:00:23 -04:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
2021-11-20 20:36:48 -05:00
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
2021-11-15 01:54:00 -05:00
|
|
|
|
2021-11-10 10:23:17 -05:00
|
|
|
jobs:
|
|
|
|
default:
|
|
|
|
name: ${{ matrix.os }} / ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }}
|
2021-11-15 01:54:00 -05:00
|
|
|
runs-on: ${{ matrix.image }}
|
2021-11-10 10:23:17 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-11-15 01:54:00 -05:00
|
|
|
os: [Ubuntu, macOS, Windows]
|
2024-11-19 13:41:54 -05:00
|
|
|
python-version:
|
|
|
|
- "3.9"
|
|
|
|
- "3.10"
|
|
|
|
- "3.11"
|
|
|
|
- "3.12"
|
|
|
|
- "3.13"
|
2021-11-10 10:23:17 -05:00
|
|
|
args:
|
|
|
|
- ""
|
|
|
|
- "--preview"
|
|
|
|
- "--git https://github.com/python-poetry/poetry.git"
|
2021-11-15 01:54:00 -05:00
|
|
|
include:
|
|
|
|
- os: Ubuntu
|
2022-09-06 04:01:00 -04:00
|
|
|
image: ubuntu-22.04
|
2021-11-15 01:54:00 -05:00
|
|
|
- os: Windows
|
|
|
|
image: windows-2022
|
|
|
|
- os: macOS
|
2022-09-06 04:01:00 -04:00
|
|
|
image: macos-12
|
2022-09-17 21:00:23 -04:00
|
|
|
fail-fast: false
|
2021-11-15 01:54:00 -05:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2021-11-10 10:23:17 -05:00
|
|
|
steps:
|
2022-06-06 13:51:12 -04:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-10 10:23:17 -05:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2022-06-06 13:51:12 -04:00
|
|
|
uses: actions/setup-python@v3
|
2021-11-10 10:23:17 -05:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Update PATH
|
|
|
|
if: ${{ matrix.os != 'Windows' }}
|
|
|
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Update PATH for Windows
|
|
|
|
if: ${{ matrix.os == 'Windows' }}
|
|
|
|
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Install Poetry
|
2023-05-16 11:19:18 -04:00
|
|
|
run: python install-poetry.py -y ${{ matrix.args }}
|
2021-11-10 10:23:17 -05:00
|
|
|
|
2021-11-11 21:59:23 -05:00
|
|
|
- name: Upload Failure Log
|
2024-11-19 13:29:27 -05:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-11-11 21:59:23 -05:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: poetry-installer-error.log
|
|
|
|
path: poetry-installer-error-*.log
|
|
|
|
|
2021-11-10 10:23:17 -05:00
|
|
|
- name: Verify Installation
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
poetry new foobar
|
|
|
|
cd foobar
|
|
|
|
poetry config virtualenvs.in-project true
|
|
|
|
poetry env use python
|
|
|
|
[ "$(poetry run python --version)" == "$(python --version)" ] \
|
|
|
|
|| { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; }
|
|
|
|
|
|
|
|
- name: Uninstall Poetry
|
|
|
|
run: |
|
|
|
|
python install-poetry.py -y --uninstall
|
|
|
|
{ type poetry 2>/dev/null >&2 && exit 1; } || exit 0
|
2022-07-14 07:32:26 -04:00
|
|
|
|
|
|
|
# debian/ubuntu needs special testing due to various issues around python packaging
|
|
|
|
# and configuration
|
|
|
|
integration-ubuntu:
|
|
|
|
name: Integration Test / Ubuntu / ${{ matrix.tag }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: docker.io/ubuntu:${{ matrix.tag }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
tag:
|
2022-09-06 03:13:36 -04:00
|
|
|
- focal
|
2022-07-14 07:32:26 -04:00
|
|
|
- jammy
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Packages
|
|
|
|
run: |
|
|
|
|
apt-get -y update
|
|
|
|
apt-get -y install python3 ca-certificates
|
|
|
|
apt-get -y install --reinstall python3-distutils
|
|
|
|
|
|
|
|
- name: Update PATH
|
|
|
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Install Poetry
|
|
|
|
env:
|
|
|
|
DEB_PYTHON_INSTALL_LAYOUT: "deb"
|
|
|
|
run: python3 install-poetry.py -y
|
|
|
|
|
|
|
|
- name: Upload Failure Log
|
2024-11-19 13:29:27 -05:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-07-14 07:32:26 -04:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: poetry-installer-error.log
|
|
|
|
path: poetry-installer-error-*.log
|
|
|
|
|
|
|
|
- name: Verify Installation
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
poetry new foobar
|
|
|
|
cd foobar
|
|
|
|
poetry config virtualenvs.in-project true
|
|
|
|
poetry env use python3
|
|
|
|
[ "$(poetry run python --version)" == "$(python3 --version)" ] \
|
|
|
|
|| { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; }
|
|
|
|
|
|
|
|
- name: Uninstall Poetry
|
|
|
|
run: |
|
|
|
|
python3 install-poetry.py -y --uninstall
|
|
|
|
{ type poetry 2>/dev/null >&2 && exit 1; } || exit 0
|