Skip to content

Commit 7fb56df

Browse files
authored
Merge pull request #641 from freqtrade/use_uv
chore: simplify CI, use UV
2 parents 8ce873e + fb71be5 commit 7fb56df

File tree

1 file changed

+27
-75
lines changed

1 file changed

+27
-75
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ permissions:
2222

2323
jobs:
2424
test:
25-
25+
name: Tests
2626
runs-on: ${{ matrix.os }}
2727
strategy:
2828
matrix:
29-
os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-13", "macos-14", "macos-15" ]
29+
os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-13", "macos-14", "macos-15", "windows-2022", "windows-2025" ]
3030
python-version: ["3.10", "3.11", "3.12", "3.13"]
3131
exclude:
3232
- os: macos-13
@@ -42,32 +42,19 @@ jobs:
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444

45-
- name: Cache_dependencies
46-
uses: actions/cache@v4
47-
id: cache
48-
with:
49-
path: ~/dependencies/
50-
key: ${{ matrix.os }}-dependencies
51-
52-
- name: pip cache (linux)
53-
uses: actions/cache@v4
54-
if: startsWith(matrix.os, 'ubuntu')
45+
- name: Install uv
46+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0
5547
with:
56-
path: ~/.cache/pip
57-
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
58-
59-
- name: pip cache (macOS)
60-
uses: actions/cache@v4
61-
if: startsWith(matrix.os, 'macOS')
62-
with:
63-
path: ~/Library/Caches/pip
64-
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
48+
activate-environment: true
49+
enable-cache: true
50+
python-version: ${{ matrix.python-version }}
51+
cache-dependency-glob: "requirements**.txt"
52+
cache-suffix: "${{ matrix.python-version }}"
6553

6654
- name: Installation - *nix
6755
run: |
68-
python -m pip install --upgrade pip
69-
pip install -r requirements-dev.txt
70-
pip install -e .
56+
uv pip install -r requirements-dev.txt
57+
uv pip install -e .
7158
7259
- name: Tests
7360
run: |
@@ -97,57 +84,9 @@ jobs:
9784
details: Technical CI failed on ${{ matrix.os }}
9885
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
9986

100-
101-
test_windows:
102-
103-
runs-on: ${{ matrix.os }}
104-
strategy:
105-
matrix:
106-
os: [ "windows-2022", "windows-2025" ]
107-
python-version: ["3.10", "3.11", "3.12", "3.13"]
108-
109-
steps:
110-
- uses: actions/checkout@v5
111-
with:
112-
persist-credentials: false
113-
114-
- name: Set up Python
115-
uses: actions/setup-python@v5.1.1
116-
with:
117-
python-version: ${{ matrix.python-version }}
118-
119-
- name: Pip cache (Windows)
120-
uses: actions/cache@v4
121-
if: startsWith(runner.os, 'Windows')
122-
with:
123-
path: ~\AppData\Local\pip\Cache
124-
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip
125-
126-
- name: Installation
127-
run: |
128-
python -m pip install --upgrade pip
129-
pip install -r requirements-dev.txt
130-
pip install -e .
131-
132-
- name: Tests
133-
run: |
134-
pytest --random-order
135-
136-
- name: Run Ruff
137-
run: |
138-
ruff check --output-format=github .
139-
140-
- name: Discord notification
141-
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
142-
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
143-
with:
144-
severity: error
145-
details: Technical CI failed on ${{ matrix.os }}
146-
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
147-
14887
# Notify on discord only once - when CI completes (and after deploy) in case it's successfull
14988
notify-complete:
150-
needs: [ test, test_windows ]
89+
needs: [ test ]
15190
runs-on: ubuntu-latest
15291
# Discord notification can't handle schedule events
15392
if: (github.event_name != 'schedule')
@@ -169,7 +108,8 @@ jobs:
169108
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
170109

171110
build:
172-
needs: [ test, test_windows ]
111+
name: Build Python 🐍 distribution 📦
112+
needs: [ test ]
173113
runs-on: ubuntu-22.04
174114
steps:
175115
- uses: actions/checkout@v5
@@ -181,6 +121,16 @@ jobs:
181121
with:
182122
python-version: 3.11
183123

124+
- name: Install uv
125+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0
126+
with:
127+
activate-environment: true
128+
enable-cache: true
129+
python-version: 3.13
130+
cache-dependency-glob: "requirements**.txt"
131+
cache-suffix: "build-3.13"
132+
133+
184134
- name: Extract branch name
185135
id: extract-branch
186136
run: |
@@ -189,7 +139,7 @@ jobs:
189139
190140
- name: Build distribution
191141
run: |
192-
pip install -U build
142+
uv pip install -U build
193143
python -m build --sdist --wheel
194144
195145
- name: Upload artifacts 📦
@@ -201,6 +151,7 @@ jobs:
201151
retention-days: 10
202152

203153
deploy-test-pypi:
154+
name: "Publish Python 🐍 distribution 📦 to TestPyPI"
204155
if: (github.event_name == 'release') && github.repository == 'freqtrade/technical'
205156
needs: [ build ]
206157
runs-on: ubuntu-22.04
@@ -226,6 +177,7 @@ jobs:
226177
repository-url: https://test.pypi.org/legacy/
227178

228179
deploy-pypi:
180+
name: "Publish Python 🐍 distribution 📦 to PyPI"
229181
if: (github.event_name == 'release') && github.repository == 'freqtrade/technical'
230182
needs: [ build ]
231183
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)