From db48cc64f5148c701fb902291efd195e6beb270a Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 16 Jun 2024 15:55:51 +0200 Subject: [PATCH] split build from lint, try 3.10 as build arg --- .github/workflows/test-only.yml | 23 ++++++++++++++--------- Dockerfile | 5 ++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-only.yml b/.github/workflows/test-only.yml index 5483e6f6..e230175a 100644 --- a/.github/workflows/test-only.yml +++ b/.github/workflows/test-only.yml @@ -4,17 +4,10 @@ name: ChangeDetection.io App Test on: [push, pull_request] jobs: - test-application: + lint-code: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - # Mainly just for link/flake8 - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Lint with flake8 run: | pip3 install flake8 @@ -23,6 +16,18 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + test-application: + runs-on: ubuntu-latest + needs: lint-code + steps: + - uses: actions/checkout@v4 + + # Mainly just for link/flake8 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Spin up ancillary testable services run: | @@ -38,7 +43,7 @@ jobs: - name: Build changedetection.io container for testing run: | # Build a changedetection.io container and start testing inside - docker build --build-arg LOGGER_LEVEL=TRACE -t test-changedetectionio . + docker build --build-arg PYTHON_VERSION=3.10 --build-arg LOGGER_LEVEL=TRACE -t test-changedetectionio . # Debug info docker run test-changedetectionio bash -c 'pip list' diff --git a/Dockerfile b/Dockerfile index e592c9bb..02aeeba9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,10 @@ # @NOTE! I would love to move to 3.11 but it breaks the async handler in changedetectionio/content_fetchers/puppeteer.py # If you know how to fix it, please do! and test it for both 3.10 and 3.11 -FROM python:3.10-slim-bookworm as builder + +ARG PYTHON_VERSION=3.10 + +FROM python:${PYTHON_VERSION}-slim-bookworm as builder # See `cryptography` pin comment in requirements.txt ARG CRYPTOGRAPHY_DONT_BUILD_RUST=1