Skip to content

Commit ea79142

Browse files
committed
ci: improve installer.yml workflow
Test on newer OS versions, DRY tasks, and limit concurrency during PRs (kill current jobs on new push).
1 parent c864942 commit ea79142

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/installer.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Installation Script
1+
name: Test install-poetry.py
22

33
on:
44
push:
@@ -14,19 +14,33 @@ on:
1414
branches:
1515
- '**'
1616

17+
concurrency:
18+
group: ${{ github.head_ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
default:
1923
name: ${{ matrix.os }} / ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }}
20-
runs-on: ${{ matrix.os }}-latest
24+
runs-on: ${{ matrix.image }}
2125
strategy:
2226
matrix:
23-
os: [ Ubuntu, MacOS, Windows ]
24-
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
27+
os: [Ubuntu, macOS, Windows]
28+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
2529
args:
2630
- ""
2731
- "--preview"
2832
- "--git https://github.com/python-poetry/poetry.git"
2933
- "--version 1.1.11"
34+
include:
35+
- os: Ubuntu
36+
image: ubuntu-latest
37+
- os: Windows
38+
image: windows-2022
39+
- os: macOS
40+
image: macos-11
41+
defaults:
42+
run:
43+
shell: bash
3044
steps:
3145
- uses: actions/checkout@v2
3246

@@ -37,16 +51,13 @@ jobs:
3751

3852
- name: Update PATH
3953
if: ${{ matrix.os != 'Windows' }}
40-
shell: bash
4154
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
4255

4356
- name: Update PATH for Windows
4457
if: ${{ matrix.os == 'Windows' }}
45-
shell: bash
4658
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
4759

4860
- name: Install Poetry
49-
shell: bash
5061
run: python install-poetry.py -y
5162

5263
- name: Upload Failure Log
@@ -57,7 +68,6 @@ jobs:
5768
path: poetry-installer-error-*.log
5869

5970
- name: Verify Installation
60-
shell: bash
6171
run: |
6272
set -e
6373
poetry new foobar
@@ -68,7 +78,6 @@ jobs:
6878
|| { echo >&2 "ERROR: Virtual environment Python version do not match system version." && exit 1; }
6979
7080
- name: Uninstall Poetry
71-
shell: bash
7281
run: |
7382
python install-poetry.py -y --uninstall
7483
{ type poetry 2>/dev/null >&2 && exit 1; } || exit 0

0 commit comments

Comments
 (0)