From 181d3a3808412f35be91165e9e092bc0ea5209ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Oct 2020 05:49:32 +0000 Subject: [PATCH 1/5] Bump python from 3.8.6-slim-buster to 3.9.0-slim-buster Bumps python from 3.8.6-slim-buster to 3.9.0-slim-buster. Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2be65274e..68b37afe3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8.6-slim-buster +FROM python:3.9.0-slim-buster RUN apt-get update \ && apt-get -y install curl build-essential libssl-dev sqlite3 \ From dd42d61d03d584051b39c4ada5132f9d223bcdbd Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 7 Oct 2020 08:48:45 +0200 Subject: [PATCH 2/5] Run CI on 3.9 --- .github/workflows/ci.yml | 4 ++-- setup.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f259129d4..d48dec2d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ ubuntu-18.04, ubuntu-20.04, macos-latest ] - python-version: [3.7, 3.8] + python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 @@ -119,7 +119,7 @@ jobs: strategy: matrix: os: [ windows-latest ] - python-version: [3.7, 3.8] + python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/setup.sh b/setup.sh index 049a6a77e..419fde9bb 100755 --- a/setup.sh +++ b/setup.sh @@ -42,7 +42,7 @@ function check_installed_python() { fi if [ -z ${PYTHON} ]; then - echo "No usable python found. Please make sure to have python3.6 or python3.7 installed" + echo "No usable python found. Please make sure to have python3.6, python3.7 or python3.8 installed" exit 1 fi } From 9725b8e17cebe927ea2a0faa5f43e302c4cc18dd Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 8 Dec 2020 08:43:22 +0100 Subject: [PATCH 3/5] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 68b37afe3..ea94822c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.0-slim-buster +FROM python:3.9.1-slim-buster RUN apt-get update \ && apt-get -y install curl build-essential libssl-dev sqlite3 \ From a4bfd0b0aa6556e47484fc67a675170b9ddd760e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Dec 2020 11:25:42 +0100 Subject: [PATCH 4/5] Split linux and OSX builds into 2 seperate, parallel jobs --- .github/workflows/ci.yml | 102 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 94 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d48dec2d3..36a9fc374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,12 @@ on: - cron: '0 5 * * 4' jobs: - build: + build_linux: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-18.04, ubuntu-20.04, macos-latest ] + os: [ ubuntu-18.04, ubuntu-20.04 ] python-version: [3.7, 3.8, 3.9] steps: @@ -31,21 +31,105 @@ jobs: python-version: ${{ matrix.python-version }} - name: Cache_dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 id: cache with: path: ~/dependencies/ key: ${{ runner.os }}-dependencies - name: pip cache (linux) - uses: actions/cache@preview + uses: actions/cache@v2 if: startsWith(matrix.os, 'ubuntu') with: path: ~/.cache/pip key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip + - name: TA binary *nix + if: steps.cache.outputs.cache-hit != 'true' + run: | + cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd .. + + - name: Installation - *nix + run: | + python -m pip install --upgrade pip + export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH + export TA_LIBRARY_PATH=${HOME}/dependencies/lib + export TA_INCLUDE_PATH=${HOME}/dependencies/include + pip install -r requirements-dev.txt + pip install -e . + + - name: Tests + run: | + pytest --random-order --cov=freqtrade --cov-config=.coveragerc + + - name: Coveralls + if: (startsWith(matrix.os, 'ubuntu-20') && matrix.python-version == '3.8') + env: + # Coveralls token. Not used as secret due to github not providing secrets to forked repositories + COVERALLS_REPO_TOKEN: 6D1m0xupS3FgutfuGao8keFf9Hc0FpIXu + run: | + # Allow failure for coveralls + coveralls -v || true + + - name: Backtesting + run: | + cp config.json.example config.json + freqtrade create-userdir --userdir user_data + freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy + + - name: Hyperopt + run: | + cp config.json.example config.json + freqtrade create-userdir --userdir user_data + freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all + + - name: Flake8 + run: | + flake8 + + - name: Sort imports (isort) + run: | + isort --check . + + - name: Mypy + run: | + mypy freqtrade scripts + + - name: Slack Notification + uses: homoluctus/slatify@v1.8.0 + if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) + with: + type: ${{ job.status }} + job_name: '*Freqtrade CI ${{ matrix.os }}*' + mention: 'here' + mention_if: 'failure' + channel: '#notifications' + url: ${{ secrets.SLACK_WEBHOOK }} + + build_macos: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ macos-latest ] + python-version: [3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache_dependencies + uses: actions/cache@v2 + id: cache + with: + path: ~/dependencies/ + key: ${{ runner.os }}-dependencies + - name: pip cache (macOS) - uses: actions/cache@preview + uses: actions/cache@v2 if: startsWith(matrix.os, 'macOS') with: path: ~/Library/Caches/pip @@ -113,13 +197,14 @@ jobs: channel: '#notifications' url: ${{ secrets.SLACK_WEBHOOK }} + build_windows: runs-on: ${{ matrix.os }} strategy: matrix: os: [ windows-latest ] - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8] steps: - uses: actions/checkout@v2 @@ -215,7 +300,7 @@ jobs: # Notify on slack only once - when CI completes (and after deploy) in case it's successfull notify-complete: - needs: [ build, build_windows, docs_check ] + needs: [ build_linux, build_macos, build_windows, docs_check ] runs-on: ubuntu-20.04 steps: - name: Slack Notification @@ -228,8 +313,9 @@ jobs: url: ${{ secrets.SLACK_WEBHOOK }} deploy: - needs: [ build, build_windows, docs_check ] + needs: [ build_linux, build_macos, build_windows, docs_check ] runs-on: ubuntu-20.04 + if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade' steps: - uses: actions/checkout@v2 From dad427461d88ea70697f42b91c136ba9284b8f6e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Dec 2020 13:11:04 +0100 Subject: [PATCH 5/5] Downgrade dockerfile to 3.8.6 to avoid image bloat --- Dockerfile | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 445f909b0..602e6a28c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.1-slim-buster as base +FROM python:3.8.6-slim-buster as base # Setup env ENV LANG C.UTF-8 diff --git a/docker-compose.yml b/docker-compose.yml index a99aac3c7..7094500b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: # Build step - only needed when additional dependencies are needed # build: # context: . - # dockerfile: "./Dockerfile.technical" + # dockerfile: "./docker/Dockerfile.technical" restart: unless-stopped container_name: freqtrade volumes: