-
Notifications
You must be signed in to change notification settings - Fork 53
109 lines (101 loc) · 3.47 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
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" ]
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)"
# 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/install-poetry@v1.2
- uses: snok/install-poetry@v1.3