mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
chore(ci): combine windows ci into generic test runner
This commit is contained in:
98
.github/workflows/ci.yml
vendored
98
.github/workflows/ci.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15" ]
|
os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15" , "windows-2022", "windows-2025" ]
|
||||||
python-version: ["3.11", "3.12", "3.13"]
|
python-version: ["3.11", "3.12", "3.13"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
- name: Tests
|
- name: Tests
|
||||||
if: (!(runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04'))
|
if: (!(runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04'))
|
||||||
run: |
|
run: |
|
||||||
pytest --random-order
|
pytest --random-order --durations 20
|
||||||
|
|
||||||
- name: Tests with Coveralls
|
- name: Tests with Coveralls
|
||||||
if: (runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04')
|
if: (runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04')
|
||||||
@@ -135,91 +135,13 @@ jobs:
|
|||||||
ruff format --check
|
ruff format --check
|
||||||
|
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-15'
|
if: ${{ matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-15' }}
|
||||||
run: |
|
|
||||||
mypy freqtrade scripts tests
|
|
||||||
|
|
||||||
- name: Discord notification
|
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
|
||||||
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Freqtrade CI failed on ${{ matrix.os }}
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
|
|
||||||
build-windows:
|
|
||||||
name: "Tests and Linting - Windows"
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ "windows-2022", "windows-2025" ]
|
|
||||||
python-version: ["3.11", "3.12", "3.13"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
|
|
||||||
with:
|
|
||||||
activate-environment: true
|
|
||||||
enable-cache: true
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache-dependency-glob: "requirements**.txt"
|
|
||||||
cache-suffix: "${{ matrix.python-version }}"
|
|
||||||
|
|
||||||
- name: Installation
|
|
||||||
run: |
|
|
||||||
uv pip install -r requirements-dev.txt
|
|
||||||
uv pip install -e .
|
|
||||||
|
|
||||||
- name: Tests
|
|
||||||
run: |
|
|
||||||
pytest --random-order --durations 20 -n auto
|
|
||||||
|
|
||||||
- name: Check for repository changes
|
|
||||||
run: |
|
|
||||||
if (git status --porcelain) {
|
|
||||||
Write-Host "Repository is dirty, changes detected:"
|
|
||||||
git status
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Repository is clean, no changes detected."
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Backtesting
|
|
||||||
run: |
|
|
||||||
cp tests/testdata/config.tests.json config.json
|
|
||||||
freqtrade create-userdir --userdir user_data
|
|
||||||
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
|
||||||
|
|
||||||
- name: Hyperopt
|
|
||||||
run: |
|
|
||||||
cp tests/testdata/config.tests.json config.json
|
|
||||||
freqtrade create-userdir --userdir user_data
|
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
|
||||||
|
|
||||||
- name: Run Ruff
|
|
||||||
run: |
|
|
||||||
ruff check --output-format=github
|
|
||||||
|
|
||||||
- name: Run Ruff format check
|
|
||||||
run: |
|
|
||||||
ruff format --check
|
|
||||||
|
|
||||||
- name: Mypy
|
|
||||||
run: |
|
run: |
|
||||||
mypy freqtrade scripts tests
|
mypy freqtrade scripts tests
|
||||||
|
|
||||||
- name: Run Pester tests (PowerShell)
|
- name: Run Pester tests (PowerShell)
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$PSVersionTable
|
$PSVersionTable
|
||||||
Set-PSRepository psgallery -InstallationPolicy trusted
|
Set-PSRepository psgallery -InstallationPolicy trusted
|
||||||
@@ -228,14 +150,12 @@ jobs:
|
|||||||
Invoke-Pester -Path "tests" -CI
|
Invoke-Pester -Path "tests" -CI
|
||||||
if ($Error.Length -gt 0) {exit 1}
|
if ($Error.Length -gt 0) {exit 1}
|
||||||
|
|
||||||
shell: powershell
|
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
||||||
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
if: ${{ failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
|
||||||
with:
|
with:
|
||||||
severity: error
|
severity: error
|
||||||
details: Test Failed
|
details: Freqtrade CI failed on ${{ matrix.os }} with Python ${{ matrix.python-version }}!
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
mypy-version-check:
|
mypy-version-check:
|
||||||
@@ -341,7 +261,6 @@ jobs:
|
|||||||
notify-complete:
|
notify-complete:
|
||||||
needs: [
|
needs: [
|
||||||
tests,
|
tests,
|
||||||
build-windows,
|
|
||||||
docs-check,
|
docs-check,
|
||||||
mypy-version-check,
|
mypy-version-check,
|
||||||
pre-commit,
|
pre-commit,
|
||||||
@@ -373,7 +292,7 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
name: "Build"
|
name: "Build"
|
||||||
needs: [ tests, build-windows, docs-check, mypy-version-check, pre-commit ]
|
needs: [ tests, docs-check, mypy-version-check, pre-commit ]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -472,7 +391,6 @@ jobs:
|
|||||||
name: "Docker Build and Deploy"
|
name: "Docker Build and Deploy"
|
||||||
needs: [
|
needs: [
|
||||||
tests,
|
tests,
|
||||||
build-windows,
|
|
||||||
docs-check,
|
docs-check,
|
||||||
mypy-version-check,
|
mypy-version-check,
|
||||||
pre-commit
|
pre-commit
|
||||||
|
|||||||
Reference in New Issue
Block a user