Skip to content

Commit 54e861e

Browse files
committed
ci: build out new support matrix job
1 parent 860c569 commit 54e861e

File tree

2 files changed

+103
-137
lines changed

2 files changed

+103
-137
lines changed

.github/workflows/installer.yml

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Support Matrix
2+
3+
on:
4+
push:
5+
paths:
6+
- 'install-poetry.py'
7+
- '.github/workflows/support-matrix.yml'
8+
branches:
9+
- main
10+
pull_request:
11+
paths:
12+
- 'install-poetry.py'
13+
- '.github/workflows/support-matrix.yml'
14+
branches:
15+
- '**'
16+
17+
concurrency:
18+
group: installer-${{ github.head_ref || github.ref }}
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20+
21+
jobs:
22+
feature-matrix:
23+
name: ${{ matrix.python-version }} / ${{ matrix.args }}
24+
runs-on: ubuntu-22.04
25+
continue-on-error: ${{ matrix.experimental }}
26+
strategy:
27+
matrix:
28+
experimental: [false]
29+
python-version: ["3.7", "3.8", "3.9", "3.10"]
30+
args:
31+
- ""
32+
- "--version 1.1.15"
33+
- "--version 1.2.0"
34+
- "--preview"
35+
- "--git https://github.com/python-poetry/poetry.git"
36+
- "--path ./poetry"
37+
include:
38+
- args: "--version 1.1.15"
39+
python-version: "3.6"
40+
test-existing: false
41+
- python-version: "3.11-dev"
42+
experimental: true
43+
defaults:
44+
run:
45+
shell: bash
46+
steps:
47+
- uses: actions/checkout@v3
48+
49+
- uses: actions/checkout@v3
50+
with:
51+
repository: python-poetry/poetry
52+
53+
- name: Set up Python ${{ matrix.python-version }}
54+
uses: actions/setup-python@v3
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
58+
- name: Install Poetry
59+
run: python install-poetry.py -y ${{ matrix.args }}
60+
61+
- name: Upload Failure Log
62+
uses: actions/upload-artifact@v2
63+
if: failure()
64+
with:
65+
name: poetry-installer-error.log
66+
path: poetry-installer-error-*.log
67+
68+
- name: Update PATH
69+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
70+
71+
- name: Test existing project
72+
if: ${{ matrix.test-existing }}
73+
run: |
74+
set -e
75+
cd poetry
76+
77+
poetry install
78+
poetry build
79+
poetry run poetry --version
80+
poetry run poetry debug info
81+
82+
- name: Test new project
83+
run: |
84+
set -e
85+
poetry new test_project
86+
cd test_project
87+
88+
poetry env use python3
89+
90+
if [ "$(poetry run python --version)" != "$(python3 --version)" ]; then
91+
echo "ERROR: Virtual environment Python version does not match expected system version" >&2
92+
exit 1
93+
fi
94+
95+
- name: Uninstall Poetry
96+
run: |
97+
set -e
98+
python install-poetry.py -y --uninstall
99+
if command -v "poetry" >/dev/null; then
100+
which poetry
101+
echo "ERROR: Failed to uninstall Poetry?" >&2
102+
exit 1
103+
fi

0 commit comments

Comments
 (0)