-
Notifications
You must be signed in to change notification settings - Fork 251
77 lines (66 loc) · 2.26 KB
/
downstream.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
name: Poetry Downstream Tests
on:
workflow_dispatch:
pull_request: {}
push:
branches: [main]
jobs:
tests:
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
strategy:
matrix:
ref: ["main"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
path: poetry-core
- uses: actions/checkout@v4
with:
path: poetry
repository: python-poetry/poetry
ref: ${{ matrix.ref }}
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Get full python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Set up Poetry
run: |
pip install poetry
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: ./poetry/.venv
key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
working-directory: ./poetry
run: timeout 10s poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Switch downstream to development poetry-core
working-directory: ./poetry
run: |
# remove poetry-core from main group to avoid version conflicts
# with a potential entry in the test group
poetry remove poetry-core
# add to test group to overwrite a potential entry in that group
poetry add --lock --group test ../poetry-core
- name: Install downstream dependencies
working-directory: ./poetry
run: |
# force update of directory dependency in cached venv
# (even if directory dependency with same version is already installed)
poetry run pip uninstall -y poetry-core
poetry install
# TODO: mark run as success even when this fails and add comment to PR instead
- name: Run downstream test suite
working-directory: ./poetry
run: poetry run pytest