mirror of
https://github.com/python-poetry/install.python-poetry.org.git
synced 2024-11-08 23:13:38 -05:00
ci: build out new support matrix job
This commit is contained in:
parent
860c5691d6
commit
2094d081ff
2 changed files with 98 additions and 137 deletions
137
.github/workflows/installer.yml
vendored
137
.github/workflows/installer.yml
vendored
|
@ -1,137 +0,0 @@
|
|||
name: Test install-poetry.py
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'install-poetry.py'
|
||||
- '.github/workflows/installer.yml'
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- 'install-poetry.py'
|
||||
- '.github/workflows/installer.yml'
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
group: installer-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
default:
|
||||
name: ${{ matrix.os }} / ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }}
|
||||
runs-on: ${{ matrix.image }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [Ubuntu, macOS, Windows]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
|
||||
args:
|
||||
- ""
|
||||
- "--preview"
|
||||
- "--git https://github.com/python-poetry/poetry.git"
|
||||
- "--version 1.1.15"
|
||||
- "--version 1.2.0"
|
||||
include:
|
||||
- os: Ubuntu
|
||||
image: ubuntu-22.04
|
||||
- os: Windows
|
||||
image: windows-2022
|
||||
- os: macOS
|
||||
image: macos-12
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
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
|
||||
run: python install-poetry.py -y
|
||||
|
||||
- name: Upload Failure Log
|
||||
uses: actions/upload-artifact@v2
|
||||
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 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
|
||||
|
||||
# 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:
|
||||
- focal
|
||||
- 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
|
||||
uses: actions/upload-artifact@v2
|
||||
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
|
98
.github/workflows/support-matrix.yml
vendored
Normal file
98
.github/workflows/support-matrix.yml
vendored
Normal file
|
@ -0,0 +1,98 @@
|
|||
name: Support Matrix
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'install-poetry.py'
|
||||
- '.github/workflows/support-matrix.yml'
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- 'install-poetry.py'
|
||||
- '.github/workflows/support-matrix.yml'
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
feature-matrix:
|
||||
name: ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }}
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
|
||||
experimental: [false]
|
||||
args:
|
||||
- ""
|
||||
- "--version 1.1.15"
|
||||
- "--version 1.2.0"
|
||||
- "--preview"
|
||||
- "--git https://github.com/python-poetry/poetry.git"
|
||||
- "--path ./poetry"
|
||||
include:
|
||||
- args: "--version 1.1.15"
|
||||
python-version: "3.6"
|
||||
experimental: false
|
||||
- python-version: "3.11-dev"
|
||||
experimental: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: python-poetry/poetry
|
||||
path: poetry
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install Poetry
|
||||
run: |
|
||||
python install-poetry.py -y ${{ matrix.args }}
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
poetry --version
|
||||
|
||||
- name: Upload Failure Log
|
||||
uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: poetry-installer-error.log
|
||||
path: poetry-installer-error-*.log
|
||||
|
||||
- name: Test new project
|
||||
run: |
|
||||
poetry new test_project
|
||||
cd test_project
|
||||
|
||||
poetry env use python3
|
||||
if [ "$(poetry run python --version)" != "$(python3 --version)" ]; then
|
||||
echo "ERROR: Virtual environment Python version does not match expected system version" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
poetry debug info
|
||||
|
||||
- name: Test existing project
|
||||
if: ${{ !contains(matrix.args, '--version 1.1') }} # Poetry makes use of Poetry 1.2+ features
|
||||
working-directory: poetry
|
||||
run: |
|
||||
poetry install
|
||||
poetry build
|
||||
poetry run poetry --version
|
||||
poetry run poetry debug info
|
||||
|
||||
- name: Uninstall Poetry
|
||||
run: |
|
||||
python install-poetry.py -y --uninstall
|
||||
if command -v "poetry" >/dev/null; then
|
||||
which poetry
|
||||
echo "ERROR: Failed to uninstall Poetry?" >&2
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue