Repository navigation
110 lines (95 loc) · 3.22 KB
/
Copy pathdependency-range.yml
File metadata and controls
110 lines (95 loc) · 3.22 KB
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
name: Dependency Range
on:
schedule:
- cron: "17 9 * * 1"
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- pyproject.toml
- uv.lock
- .github/workflows/dependency-range.yml
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
dependency-range:
name: Dependencies (${{ matrix.profile }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- profile: minimum-direct
resolution: lowest-direct
- profile: latest
resolution: highest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "0.11.2"
enable-cache: true
cache-dependency-glob: pyproject.toml
- name: Create environment
run: uv venv .venv
- name: Resolve ${{ matrix.profile }} dependencies
env:
PROFILE: ${{ matrix.profile }}
RESOLUTION: ${{ matrix.resolution }}
run: |
uv pip compile pyproject.toml \
--extra deno \
--extra dev \
--extra test_extras \
--resolution "$RESOLUTION" \
--python .venv/bin/python \
--refresh \
--no-sources \
--output-file "$RUNNER_TEMP/requirements-$PROFILE.txt"
uv pip sync \
--strict \
--python .venv/bin/python \
"$RUNNER_TEMP/requirements-$PROFILE.txt"
uv pip install \
--python .venv/bin/python \
--no-deps \
--editable .
uv pip check --python .venv/bin/python
uv pip list --python .venv/bin/python
uv run --frozen --no-sync --python .venv/bin/python python -c \
'import deno, subprocess; subprocess.run([deno.find_deno_bin(), "--version"], check=True)'
- name: Run non-live tests
env:
PROFILE: ${{ matrix.profile }}
run: |
set +e
uv run --frozen --no-sync pytest -q -n auto --dist worksteal tests/ --extra --deno 2>&1 \
| tee "$RUNNER_TEMP/pytest-$PROFILE.log"
TEST_STATUS=${PIPESTATUS[0]}
set -e
{
echo "## Dependencies ($PROFILE)"
echo
if [ "$TEST_STATUS" -eq 0 ]; then
echo "✅ Non-live test suite passed."
else
echo "❌ Non-live test suite failed."
echo
echo '```text'
if ! grep -E '^(FAILED|ERROR) |[0-9]+ failed, [0-9]+ passed' "$RUNNER_TEMP/pytest-$PROFILE.log"; then
tail -n 20 "$RUNNER_TEMP/pytest-$PROFILE.log"
fi
echo '```'
fi
} >> "$GITHUB_STEP_SUMMARY"
exit "$TEST_STATUS"