Skip to content

Commit c0e0f9d

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

File tree

2 files changed

+92
-137
lines changed

2 files changed

+92
-137
lines changed

.github/workflows/installer.yml

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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 }} / install-poetry.py ${{ matrix.args }}
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
python-version: ["3.7", "3.8", "3.9", "3.10"]
28+
legacy: [false]
29+
args:
30+
- ""
31+
- "--version 1.1.15"
32+
- "--version 1.2.0"
33+
- "--preview"
34+
- "--git https://github.com/python-poetry/poetry.git"
35+
- "--path ./poetry"
36+
include:
37+
- args: "--version 1.1.15"
38+
python-version: "3.6"
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- uses: actions/checkout@v3
43+
with:
44+
repository: python-poetry/poetry
45+
path: poetry
46+
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v3
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
52+
- name: Install Poetry
53+
run: |
54+
python install-poetry.py -y ${{ matrix.args }}
55+
echo "$HOME/.local/bin" >> $GITHUB_PATH
56+
57+
- name: Upload Failure Log
58+
uses: actions/upload-artifact@v2
59+
if: failure()
60+
with:
61+
name: poetry-installer-error.log
62+
path: poetry-installer-error-*.log
63+
64+
- name: Test Poetry project
65+
if: ${{ !contains(matrix.args, '--version 1.1') }}
66+
working-directory: poetry
67+
run: |
68+
poetry install
69+
poetry build
70+
poetry run poetry --version
71+
poetry run poetry debug info
72+
73+
- name: Test new project
74+
run: |
75+
poetry new test_project
76+
cd test_project
77+
78+
poetry env use python3
79+
80+
if [ "$(poetry run python --version)" != "$(python3 --version)" ]; then
81+
echo "ERROR: Virtual environment Python version does not match expected system version" >&2
82+
exit 1
83+
fi
84+
85+
- name: Uninstall Poetry
86+
run: |
87+
python install-poetry.py -y --uninstall
88+
if command -v "poetry" >/dev/null; then
89+
which poetry
90+
echo "ERROR: Failed to uninstall Poetry?" >&2
91+
exit 1
92+
fi

0 commit comments

Comments
 (0)