-
Notifications
You must be signed in to change notification settings - Fork 53
135 lines (125 loc) · 4.24 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: tests
on:
pull_request:
push:
branches:
- main
defaults:
run:
shell: bash
jobs:
# Make sure the action works using the default settings
test-install:
name: default ${{ matrix.poetry-version }} ${{ matrix.os }} ${{ matrix.python-version }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
poetry-version: [ "1.6.1", "1.7.1", "1.8.1" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./
with:
version: "${{ matrix.poetry-version }}"
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- run: |
poetry install --no-root --no-interaction
poetry install --no-interaction
poetry run pytest --version
# Make sure the action sets config options correctly
test-config-options:
name: non-standard config - ${{ matrix.os }} ${{ matrix.python-version }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- uses: ./
with:
version: 1.7.1
virtualenvs-create: false
virtualenvs-in-project: true
virtualenvs-path: ~/.cache/test
installer-parallel: false
- run: |
source .github/scripts/assert.sh
assert_in "1.7.1" "$(poetry --version)"
assert_in "false" "$(poetry config virtualenvs.create)"
assert_in "true" "$(poetry config virtualenvs.in-project)"
assert_in "test" "$(poetry config virtualenvs.path)"
assert_in "false" "$(poetry config installer.parallel)"
# Check that installation-arguments works
test-installation-arguments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
installation-arguments: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d
- run: |
source .github/scripts/assert.sh
assert_in "1.1.9" "$(poetry --version)"
# Check that plugins installing works
test-plugin-installation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
plugins: poetry-plugin-bundle
- run: |
source .github/scripts/assert.sh
assert_in "poetry-plugin-bundle" "$(poetry self show plugins)"
test-plugins-whitespace-delimited:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
plugins: |
poetry-plugin-bundle
poetry-plugin-export
- run: |
source .github/scripts/assert.sh
assert_in "poetry-plugin-bundle" "$(poetry self show plugins)"
assert_in "poetry-plugin-export" "$(poetry self show plugins)"
# Retrieve the latest poetry version from PyPI
check-latest:
runs-on: ubuntu-latest
outputs:
latest-poetry-version: ${{ steps.fetch.outputs.version }}
steps:
- name: Fetch the latest Poetry version from PyPI
id: fetch
run: |
curl -sf 'https://pypi.org/pypi/poetry/json' \
| jq -r '"version=" + .info.version' \
>> $GITHUB_OUTPUT
# Make sure the action installs the latest version by default
test-latest-version-when-unspecified:
needs: check-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
- run: |
source .github/scripts/assert.sh
assert_in "." "${{ needs.check-latest.outputs.latest-poetry-version }}"
assert_in "${{ needs.check-latest.outputs.latest-poetry-version }}" "$(poetry --version)"
# Make sure we're able to run the action with both major and minor versions
test-major-and-minor-versions:
runs-on: ubuntu-latest
steps:
- uses: snok/install-poetry@v1
- uses: snok/[email protected]
- uses: snok/[email protected]